Information générale
Catégorie:
Gestionnaire d'écran & Écrans
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.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement