Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cancel button question
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00166025
Message ID:
00166471
Views:
18
>Have a global variable initialize at the start of your for form:
>
>Form.Load Method
>----------------
>m.glExecute = .T.
>
>TextBox.LostFocus Method
>------------------------
>IF m.glExecute
> <... your TextBox.LostFocus code >
>ELSE
>
>ENDIF
>
>CancelButton.Click Method
>-------------------------
>m.glExecute = .F.
>THISFORM.Release

I´m speaking off the top of my hat (that is, I haven´t tried it out in VFP) but I guess that wouldn´t work; when exiting the TextBox, its LostFocus will fire before the focus gets to the CancelButton and its Click fires.

The only idea I have is checking for CHR(27) in the TextBox.KeyPress event, and in that case set m.glExecute to .T.. Of course, you will need to set the Cancel button so it executes on ESCAPE; Cancel.Cancel = .T., I believe.

HTH!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform