Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to determine reason for leaving a control
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00474125
Message ID:
00474975
Vues:
35
What about the "X" on a form? It calls QueryUnload but LostFocus and Valid events are fired before QueryUnload. How would one get around doing a "Cancel" it this case?

>David,
>Okay, this one is alittle more complicated.
>
>My suggestion wouild be to move your Valid code to the Lostfocus evnt (or a method called from Lostfocus). The same functionality can be done there as in the Valid. The same check would apply for lastkey and to make the control not lose focus if the value is invalid, simply issue a NODEFAULT.
>
>The Undo is a slightly different matter. Try this:
>1. Create a form-level property to use as a flag to determine if the user wants to Undo the changes.
>2. In the When event of the Undo commandbutton, add code to set the flag property to .T..
>3. In the Lostfocus, add code to not only check for lastkey but to check the flag property and if .T. you know to bypass the validity check. You then need to set the property back to .F. for the next time.
>
>The sequence of events is:
>Valid of exiting control
>When of entering control
>Lostfocus of exiting control
>Gotfocus of entering control


TIA,
- Erik Niese-Petersen

Crazy Dane in USA.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform