General information
Category:
Object Oriented Programming
>How can I avoid this ? Is there maybe a way that I can test if the "Cancel" button has been clicked so that I can use an IF statement in my Valid event to only execute if "Cancel" has NOT been selected ? I've tried to set a flag in the click event of the Cancel command button but that doesn't work !
Here is a solution from Jim Booth:
*******
1) Set the Cancel property of the Cancel button to .T.
2) At the beginning of every Valid event put this code;
IF LASTKEY() = 27
RETURN .T.
ENDIF
The cancel property makes clicking the cancel button the same as pressing Escape. This has the added feature of making pressing Escape the same as clikcing the cancle button (that is the cancel button's click evnet will fire when pressing esacpe).
********
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only