If you are using your own form baseclass, then you'll only need to change it in one place. I suppose in 8.0, you might be able to bind to the this event after setting _Screen.KeyPreview to .T. - have you tried it?
yes, fox8
i have try this solution
suppose 1 form with 1 textbox
in main prg i have write this code:
PUBLIC oHandler
oHandler=NEWOBJECT("myhandler"
do FORM form1
BINDEVENT(Form1,"KeyPress",oHandler,"mykeypress"
BINDEVENT(Form1.Text1,"KeyPress",oHandler,"mykeypress"
DEFINE CLASS myhandler AS Session
PROCEDURE mykeypress
LPARAMETERS nKeyCode, nShiftAltCtrl
WAIT WINDOW nKeyCode nowait
ENDDEFINE
I'm assuming that Form1 isn't a modal form. While the second bindevent() should work, unless the form's Keypreview property has been set true, then the form's keypress event will never fire.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.