Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Valid vs. LostFocus
Message
 
À
09/04/2003 15:55:00
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00775350
Message ID:
00775861
Vues:
12
>1) The general rule is to use valid for the contents of the current control for correct data entry.
>2) The general rule is to use setfocus to ascertain 'what should happen next' based not only on the contents of the current control; but also other controls/values of the current session as well.
>

Ric,

I would phrase this a little differently.

1) Use the Valid to decide if focus will be allowed to leave the control. This may be more than simply checking the value for validity.
2) Use the LostFocus to react to the focus leaving the control. Again this may be more than simply deciding where focus should go.

One other comment. In OOP, calling an event in code is a symptom of poor design (Thisform.cmdButton.Click()). If the control and the command button should be doing the same action then they should both be calling the same method, that is the command button's click evetn calls Thisform.Dosomething() and the Lostfocus of the textbox also calls Thisform.Dosomething(). The textbos should NOT be calling the button's click event.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform