Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Assign Event
Message
De
15/09/1998 18:53:40
Bob Lucas
The WordWare Agency
Alberta, Canada
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Assign Event
Divers
Thread ID:
00137057
Message ID:
00137057
Vues:
55
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?
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform