christophe
Fri Jan 05 06:44:05 CST 2007
Hi,
why not trap the esc key in the forms keypress
with yourform.keypreview = .T.
and a NoDefault ?
something like this :
yourform.keypress
lparameters nkeycode,nshiftaltctrl
if nkeycode = 27
nodefault
thisform.release &&or whatever you want
endif
regards
christophe
"Man-wai Chang" <toylet.toylet@gmail.com> schreef in bericht
news:ORldS1LMHHA.3556@TK2MSFTNGP03.phx.gbl...
> Man-wai Chang wrote:
>>
>> Is there a smarter way of stopping ESC from being passed from one form
>> to another?
>>
>> For example, I have a formA.txt.valid() that returns .t. if lastkey()=27
>> for shutting down the form.
>>
>> I then called up a search form, and pressed ESC. The lastkey() will
>> become 27. Now formA would see it, and formA.txt will react incorrectly.
>>
>> I am doing these in all search forms' unload() method:
>>
>> keyboard chr(254)
>> inkey()
>>
>>
>
> In short, make/localize lastkey() to depends on activeform.
>
> --
> .~. Might, Courage, Vision, SINCERITY.
http://www.linux-sxs.org
> / v \ Simplicity is Beauty! May the Force and Farce be with you!
> /( _ )\ (Ubuntu 6.10) Linux 2.6.19.1
> ^ ^ 19:32:01 up 24 days 1:44 0 users load average: 1.04 1.03 1.00
> news://news.3home.net news://news.hkpcug.org news://news.newsgroup.com.hk