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

Benoit Minisini gambas at ...1...
Wed Jan 11 23:39:44 CET 2006


On Wednesday 11 January 2006 21:15, A Person wrote:
> 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
>

A Label only displays things, and cannot get focus, and so I think it never 
raises keyboard events.

Regards,

-- 
Benoit Minisini





More information about the User mailing list