General information
Category:
Coding, syntax & commands
Title:
Keypress/Keypreview in Form level not acting right?
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only