Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Valid()
Message
 
 
À
10/04/2003 16:12:23
John Vlahos
V I Software Solutions Design
Mississauga, Ontario, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00776305
Message ID:
00776353
Vues:
10
>Is there a property to set which will allow the triggering of the Valid() event if and only if the value of cell of a text or combo box has changed?
>
>For example the user tabs into the cell and then tabs out I would only wish that the valid() event be performed if the user changed the value while in the cell. If the user made absolutely no change I wish the valid not be performed.
>
>Is there a simple solution for this?
>
>Thanks in advance!

If you controls are class based, you can add the following modifications to these classes:

Add 2 new properties to every class:
PreviousValue
ValidateAlways (this would be a property to validate even if no changes were made at all).

In GotFocus event of your controls add:
this.PreviousValue = this.value

in Valid add
if this.ValidateAlways or this.value<>this.PreviousValue
execute your validation code
endif
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform