Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cancel button question
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00166025
Message ID:
00166471
Vues:
22
>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!
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform