General information
Category:
Coding, syntax & commands
>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
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