Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to apply ON KEY LABEL
Message
From
12/03/2002 08:36:50
 
 
To
12/03/2002 04:43:09
Hee Lim Wang
Fantasy Software Enterprise
Malaysia
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00631371
Message ID:
00631432
Views:
26
so how to use function key to click my Edit Button instead of using mouse ?

If I understand what you want to do correctly, All you need to do is specifiy a hot key for your edit button like this in its caption: "\ + "E", it wil be the same as if they have clicked the edit button.

If you must use the F2 key instead, it is a bad idea to use an OKL. An OKL unconditionally interrupts whatever code is running and you have no control over it. Instead, step the form's KeyPreview proerty to true and in the form's KeyPress method, put this code:
IF nKeyCode = -1
   *** F2 key pressed
   ThisForm.MyEditMethod()
ENDIF
I would suggest that the code in your Edit button's click method also be the same as this line, that is: ThisForm.MyEditMethod(). All the code needed from both the button click and the press of the F2 key should go into that custom form method.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform