Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Valid event - how to change default text - Invalid input
Message
De
02/10/2002 09:04:03
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00706765
Message ID:
00706812
Vues:
25
You can use the VALID event in this manner and it will not return the default message:

if lastkey() = 27 or :
empty(this.value)

return 1

endif

if (validation code ok)

return 1

else
this.value = ""
messagebox("INVALID INPUT",48,"ATTENTION")
return 0
endif

The above code lets you bypass the validation altogether when the user presses a cancel button or some other control. If the validation does not succeed, you can show your own message, as above. If it succeeds, the next event that fires is LOSTFOCUS. In there you can use a form property to return the .F. value that you need.
Or save data or do whatever else has to be done after the validation took place.

I find the valid method very useful but you need to know how to use it properly.
Rafael Copquin
Treasurer - Microsoft Users Group of Argentina (MUG)
www.mug.org.ar
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform