Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to make form respond to Escape
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
00981662
Message ID:
00982546
Vues:
25
I've done this a lot, even with ActiveX controls on the form, and I've never had to setfocus before it would work. One thing that may be getting in your way is any validation going on. I bracket validation code with IF NOT LASTKEY() = 27 so that Escape will bypass the validation and just exit the form.

>Problem was fixed by adding Thisform.PageFrame1.Page1.Command2.SetFocus() in Thisform.Init().
>
>Maybe problem was created because there is an OleControl in page1?
>
>Thanks,
>
>Alex
>
>>Hi,
>>
>>A form has a pageframe an in a page a command button for which I set Cancel .T., wishing it to respond to escape key. However, the escape key does not cause the commandbutton click to fire. Next I added code in Thisform.KeyPress and Thisform.KeyPreview = .T., but still no response to Escape key.
>>
>>What am doing wrong?
>>
>>Thanks,
>>
>>Alex
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform