Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Messages of Validations
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00261658
Message ID:
00263103
Vues:
22
>Hi Jim,
>
>>
>>Put your validation code in the valid event. If the data is invalid you can use the MessageBox() function to display any message you like and then RETURN 0 from the valid event. Returning .F. will display the VFP message and retain focus in the control. Returning 0 will NOT dislpay the VFP message but it will retain focus in the control.
>
>And which is better? your solution or putting the validation in the lostfocus event and then issue a this.setfocus() when you have an error???
>
>Regards,

Pablo,

Using LostFocsu to determine whether the user will be allowed to exit a control is misuing the LostFocus event. There is an event for that purpose, Valid.

Your question asked which one I thought is better, not which one will wokr. They both will work, but I find using the events as they were intended is a better way to work.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform