>Hi Cetin,
>
>>Otherwise after an ESC and continuing with mouse clicks would beat valid (lastkey=27).
>
>But an ESC would clear the form anyway. But what about future forms? Maybe, in the Click() event of your Cancel button class, you could reset it? I don't know how, just an idea :-)
Yeah, "generally" cancel = .t. button releases form. Poking a dummy key value in button in cancel button code is another way to skin the cat :) I prefer the idea doing it in first place and freeing of thinking to stick to a special button class or checking if you coded it there :)
PS: I really rarely use valid event (lostfocus more often).
Cetin