Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Valid()
Message
 
 
To
10/04/2003 16:12:23
John Vlahos
V I Software Solutions Design
Mississauga, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00776305
Message ID:
00776353
Views:
9
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform