Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problems with fairly straightforward form requirements.
Message
From
21/07/1999 11:27:20
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00243408
Message ID:
00244178
Views:
18
>Ok, let's start simple. A textbox has a Value property. When the textbox has a controlsource the value property will reflect the value of the controlsource. As a use types in teh textbox the value property changes, the value property will update the controlsource just before the Valid event fires, so in the Valid the Value and the controlsource's value are the same. Prior to the Valid the value and the controlsource may not be the same.

I suspected this was the basic functionality. Looks like value prop holds the intermediate value as the user is typing in new characters then ENTER triggers the event that synchronizes the value prop with the controlsource.

I find it interesting that the controlsource is synchronized to the value property just before Valid fires. It seems like you'd want to hold off on revaluing the controlsource until you actually check to see if the new value is in range. It's pretty conventional to leave the original value of a variable unchanged if the requested new value is out of range. So, how would you do this in a Valid method if the controlsource (and therefore the old value) has already been overwritten?

BTW. I just discovered the Assign and Access methods for properties and have successfully used the assign to validate a property I was using as a control source. Seems to work great, plus, I have access to the 'old' value of the property just in case I want to retain it in the presence of an illegal new value.
"The Iron Fish: The water is cold...but the fish don't mind"
...Jay Jenks, boyhood chum
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform