Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using On Key in a Form
Message
 
 
À
21/05/2001 15:33:30
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00509644
Message ID:
00509651
Vues:
19
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform