Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VALID=.F. except when you press CANCEL?
Message
From
14/01/1999 18:00:55
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00176248
Message ID:
00176251
Views:
26
>In many situations, I'll want a user to stay in the current field until they enter a valid value - OR - until they press the CANCEL button! I know that I can keep them in the field by returning .F. in the VALID method, but how can I account for that CANCEL button?
>
>TIA

If your Cancel button has Cancel=.T. then Lastkey() will return 27 when the button is pressed, just as if the user pressed Esc.
So put
IF LASTKEY()=27
   return .T.
endif
in your Valid event
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform