Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ON KEY LABEL
Message
From
21/11/2001 04:27:32
 
 
To
21/11/2001 03:48:25
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00584338
Message ID:
00584344
Views:
22
>How to use On key label eg. F1 to run a method in form?
>

ON KEY LABEL works outside the context for the Form, so references like "this", "thisform", etc cannot be used in this context. Instead, add code to the KeyPress event of the Form that traps the keystroke(s) of interest, and triggers an appropriate message; this way, the oject context is maintained consistently.

The alternative is to try to add references through the _SCREEN.ActiveForm property reference, which introduces a layer of ambiguity of reference and breaks encapsulation, requiring that all Forms implement the same common set of methods and responds identically to all the same keystrokes. THis is a bad idea.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform