Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Keypress/Keypreview in Form level not acting right?
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Keypress/Keypreview in Form level not acting right?
Miscellaneous
Thread ID:
00003207
Message ID:
00003207
Views:
99
I want to trap the ESC key and the F2 key in my form at the form level. On pressing the ESC key, if the user is currently in the grid of the form, it then sets focus on the first textbox of the form. Similarily, when press F2 , it updates the file, then sets focus to first txtbox of form.

When I do this with all code in form level, with keypreview .T., the cursor ends up in the textbox, but with a funny looking character when F2 is pressed, or it deselects the box when ESC is pressed. I have box formatted with 'K' to select entire box.

When I put all code into EACH field of entire form, and form's keypreview is .F., everything works great!

Anyone know why this is happening, or can give me a workaround? as now I have to make sure that EVERY item on my form has the same keypress method code to ensure the user gets the same reaction no matter where on the form they are.

Thanks for any comments/suggestions/opinions?

Jim.
Next
Reply
Map
View

Click here to load this message in the networking platform