Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
On key label in forms
Message
De
24/09/1998 23:44:43
 
 
À
24/09/1998 23:14:57
Sudhir Arora
Userease Software Pvt. Ltd.
New Delhi, Inde
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00140676
Message ID:
00140687
Vues:
35
>How can on key label command be used in forms ? When I write following commands in Load event of the form :
>on key label Ctrl+A thisform.pageframe1.page1.command1.click() ;
>an error message "Thisform can only be used within a method" appears.

There is a simple rule to remember when using On Key Label with forms:
Don't ever do it.

To perform an action in a form when a user presses a certain key combination, intercept the key in the form.KeyPress event.
Form.KeyPress()
LPARA nKeyCode, nShiftAltCtrl

IF nKeyCode = ASC('A') and nShiftAltCtrl = 2
    NODEFAULT
    thisform.pageframe1.page1.command1.click()
ENDIF
For this code to work form-wide, the form KeyPreview property must be set to .T.
hth
Erik Moore
Clientelligence
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform