Use the keypreview property (set it to true) and the keypress event of 
the form:

if nKeyCode = 27
   release thisform
endif

Rafael Copquin



El 28/06/2011 14:12, Kurt Wendt escribió:
> OK - Maybe its just a Brain-Fart, but, gosh - I thought this would be a
> "No-Brainer"...
>
> I am making a small Form, for the entry of just a couple of items of
> data, but, I want to allow the user to ESCape from the Form by hitting
> the<ESC>  key. I tried using the following command:
>       ON KEY LABEL ESC DO Thisform.Unload.Unload()
>
> But - VFP Yells at me that I can't use "Thisform" Except from within a
> Method.
>
> So - I'm a little lost. I even just tried to Set ESCAPE ON - and hoping
> that would work, but, of course - no go...
>
> Any suggestions? I just figured this should be something simple - and I
> MUST be missing a simple answer!
>
> TIA,
> -K-
>
[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to