Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Valid event - how to change default text - Invalid input
Message
 
À
02/10/2002 09:04:03
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00706765
Message ID:
00706821
Vues:
20
Hi Rafael!

I know about such possibility (RETURN 0).
I look for solution with RETURN .F. because it is not my code. I just try to change the code as little as possible.
Probably I stay with RETURN 0 solution it seems to work good.



>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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform