Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Identifing the current control name
Message
 
À
29/06/1998 11:34:20
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00112518
Message ID:
00112547
Vues:
30
As I understand it, you want the user to be able to click cancel on your form without firing the validation routines for whatever field they are on. here you can take advantage of the fact that when clicking a button, the Button's When event fires before the current controls lostfocus. So set a form property as a flag to whther the user is cancelling. In the When of the cancel button set the flag to true. Keep your validation in the Lostfocus of the textboxes, but only check them if the flag is false, in other words don;t check if the user is clicking the cancel button.

For example:

in the form init
this.lcancelling=.f.

In the textboxlostfocus
IF !thisform.cancelling && If the user hasn't clicked cancel
** do field validation here
ENDIF

In the cancel button When
thisform.cancelling=.t. && Which fires before the current textbox lostfocus

also in the cancel button, in the lostfocus
thisform.cancelling=.f.

--
Jerry
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform