[Gambas-user] Switching between forms in tabstrip
Jack
jscops at ...11...
Wed Feb 25 18:28:45 CET 2009
Le mercredi 25 février 2009 18:03:29 Vackoy, vous avez écrit :
> Yes, but which element/object is the observer for the Keypress?
> I tried with Workspace.Keypress but when I open a form, the observer
> becomes the form and not the workspace, so no matter what key I press it
> doesn't raise the event...
>
> M0E Lnx wrote:
> > Have not tried it but I imagine you can code that in the
> > windows_Keypress() event.
> > Should be doable
As Moe told to you, you can use windows_Keypress() event
EX. suppose you have two textbox named textbox1 and textbox2 declared in group
tbox with tag 1 & 2.
This procedure below show you how going textbox1 to textbox2 and textbox2 to
textbox1.
PUBLIC SUB Tbox_KeyPress()
IF Key.code = Key.enter OR Key.code = Key.Return OR Key.code = Key.Tab THEN
SELECT CASE LAST.tag
CASE 1
Textbox2.SetFocus
STOP EVENT
CASE 2
Textbox1.SetFocus
STOP EVENT
endif
end
I hope that it is it that you want
Jacky
More information about the User
mailing list