Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using On Key in a Form
Message
 
 
To
21/05/2001 15:33:30
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00509644
Message ID:
00509651
Views:
18
>I use On Key F1 to call a help form. While the user is on the help form I would like to have F1 then run code in a method. I'm getting an error that I must use ThisForm only in a method. I understand that I'm trapping the F1 key at the sytem level and it doesn't understand that there is a form active, but how can I work around this? I can easily put a button on the help form that runs the code I need, but it would be cleaner if the user could just use the F1 key for this secondary help. Thanks!
>
>Regards, Renoir

Renoir,
Because OKL operate outside of the form's context, you need some way of accessing the current form with VFP. You might be able to get an object reference to the form using _Screen.ActiveForm. This is accessable from OKLs.

Or as David suggested, completely do away with OKLs and use the form's KeyPreview/Keypress combination to accomplish it.

HTH.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Reply
Map
View

Click here to load this message in the networking platform