Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I get back to a previous text box if error occurr
Message
 
À
05/01/2000 18:04:43
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00313407
Message ID:
00313632
Vues:
46
>Hi Mike!
>I used your earlier reply to my message about using the return 0 command to return to the text box in case of invalid data. It works great!
>
>I have another question I think you could be of help.
>I used your return 0 in the valid of the text box, but how do I let the user get out if they want to cancel and don't want to enter data. I have a cancel button but the text box will not allow me to exit because it keeps returning the 0 to keep me there.
>Any suggestions?
>Thanks, Mike.

Mike,

Set the Cancel property of your cancel button to .T. That causes pressing the button to be the same as pressing the escape key. (BTW, it also makes pressing the escape key run the code in your cancel button's click event).

Now, in the valid of your textboxes you can;
* Textbox Valid
IF LastKey() = 27 && Escape key
   RETURN
ENDIF
* The rest of your valid code here
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform