General information
Category:
Forms & Form designer
The easy answer would be to use KEYBOARD "{ESC}" when the button click occurs, but I can't see any place to put it. Under "Tracking Event Sequences" in Help, Action 6 of the example is clicking a button while focus is in a textbox. The only button event that fires before the textbox Valid is MouseMove, which may fire even if the button isn't clicked so it's not an ideal candidate. You could set a property in the MouseMove, and assume that if the textbox's Valid is firing there must have been a click on the button since a mere move of the mouse in itself won't trigger that event.
Your textbox Valid then becomes:
IF LASTKEY()=27 OR ThisForm.lTestProperty
You would then also need to unset that property if the mouse is moved away from the button without clicking, perhaps in the MouseMove of the form itself.
If you are using VFP 8, this might be a good place for a BINDEVENTS. I'm not sure if there is a way to return the object number of the next control during a Valid, since it would imply "coupling", the OOP nemesis. But there may be.
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