Try to avoid ON KEY LABEL as much as possible, use the KeyPress() event instead. However, what I normally do is set the Cancel property to .T. on a button on the form that will close the form. This way no extra coding is required.
Frank. Frank Cazabon Samaan Systems Ltd. - Developing Solutions www.SamaanSystems.com On 28/06/2011 01:12 PM, Kurt Wendt wrote: > 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.

