Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Keeping the focus in a field
Message
De
02/03/2003 17:46:35
 
 
À
02/03/2003 10:04:08
Carmen Gassi
Perseus Software Systems
Oakville, Ontario, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00760065
Message ID:
00760176
Vues:
18
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
Fil
Voir

Click here to load this message in the networking platform