[Gambas-user] Re: Some Captured, Some Not

A Person kztyrvlq at ...966...
Wed Jan 11 21:15:29 CET 2006


Good Day Benoit . . .

The previous code was part of a much larger project and was not really a 
stand alone module so I created a sample for your attention.

I do not know what is happening but the code that I wrote here for you 
doesn't work at all.

Nothing triggers the Label KeyPress or Label KeyRelease events. 
MouseDown works.

Please try this code and tell me what I am doing wrong?

I really appreciate it.

. . .
' Gambas class file

PUBLIC SUB Form_Open()

   ' requires a form with a label "Label1"
   ' with no text
   Label1.SetFocus

END
PUBLIC SUB Label1_KeyPress()

   ' F9 (breakpoint) the next line
   Label1.Caption = "Down " & Key.Code
   ' It is never tripped

END
PUBLIC SUB Label1_KeyRelease()

   ' F9 (breakpoint) the next line
   Label1.Caption = "Up " & Key.Code
   ' It is never tripped

END
PUBLIC SUB Label1_MouseDown()

   ' to test for focus
   Label1.Caption = "MouseDown"

END
PUBLIC SUB Timer1_Timer()

   'set to interval 10
   Label1.SetFocus

END
. . .

Thanks

Paul





More information about the User mailing list