Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to make form respond to Escape
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
00981662
Message ID:
00982546
Views:
29
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform