Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to apply ON KEY LABEL
Message
De
12/03/2002 08:36:50
 
 
À
12/03/2002 04:43:09
Hee Lim Wang
Fantasy Software Enterprise
Malaisie
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00631371
Message ID:
00631432
Vues:
23
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform