Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Assign Event
Message
From
15/09/1998 18:53:40
Bob Lucas
The WordWare Agency
Alberta, Canada
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Assign Event
Miscellaneous
Thread ID:
00137057
Message ID:
00137057
Views:
54
I tested a new a simple object using the assign method. What I wanted was to have the background colour of the textbox change if the value was changed from the original value. I created a subclassed textbox and added a startingvalue property to use as a reference.

Here is the code for Value_assign method of the textbox subclass:

LPARAMETER vNewval

IF ALLTRIM(vNewval) <> ALLTRIM(this.startvalue)
this.backcolor = RGB(227, 0, 0)
ENDIF

THIS.Value = m.vNewVal

Really simple. When I assigned the initial value in the init of a form that had this textbox (first by setting the startvalue and then the textbox value so they would be the same, the assign method fired. However, it only fires if the change to the value occurs within code. If I change the value in the textbox field then the assign method does not fire. What I did to get the behaviour I wanted was add
this.value_assign(this.value) into the valid clause of the textbox so default valid behaviour is to call the assign method.

Is this the behaviour to expect? That is, the assign method only fires when a textbox receives a new value from code and not during data entry?
Next
Reply
Map
View

Click here to load this message in the networking platform