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


------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to