Information générale
Catégorie:
Codage, syntaxe et commandes
>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
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