Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How can I know when a textbox value has been changed?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00304787
Message ID:
00304802
Vues:
20
>>I have a textbox on a form, bound to a data field. I want to know, when the user exits the field, whether or not they changed the value of the textbox. I want to compare the new value to the previous value, NOT to the value of the field in the table, because the user may change the textbox several times while still in the screen.
>>
>>What's the best way to do this?
>>
>>Thanks!
>
>Hi Elyse,
>
>Look at the InteractiveChange event in the help file.

Hi George,

What about using GotFocus / LostFocus. Add a custom property to the textbox called OldVal. In GotFocus you could do this.OldVal = this.value. Then in LostFocus do:
if this.value == this.OldVal
    ** No change
else
    ** User Changed value
endif
That way you're not testing on every keystroke.

hth
Roi
'MCP' Visual FoxPro

In Rome, there was a poem.
About a dog, who found two bone.
He lick the one, he lick the other.
He went pyscho, he drop dead!
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform