Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dates before 1900
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00223881
Message ID:
00224024
Vues:
20
>>I'll have to disagree about putting this in LostFocus. Under some circumstances, it is possible for this to be bypassed. For example, assume that there's a command button that closes the form. If the user clicks on it and there's an invalid entry in the text box, the form closes. However, if this code is in the Valid, the user cannot click the command button.
>
>Hi George - I'll have to agree with Cetin, since the Lostfocus method does stop the user from clicking a button to close the form, or any other object, for that matter (with an exception...see below). Lostfocus is what I always use too. However, there's one exception you have to deal with: the built in form "title bar" closing actions - the Valid stops this, but Lostfocus doesn't. So you need to add some Queryunload code to deal with this situation if you're using Lostfocus...

Hi Bruce,

See my post to Cetin. I managed to use a command button to close a form with invalid data in a text box, with the validation code in LostFocus. I'll retry my test.

As I said to Cetin, this is largely a matter of style. I don't personally agree with using LostFocus for the reason I stated in my other post. I certainly wouldn't quibble too hard with anyone who, however.
George

Ubi caritas et amor, deus ibi est
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform