Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
InteractiveChange event way of doing things
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00019237
Message ID:
00019365
Vues:
45
>I want to call a method but only if my field value is change.
>
>Right now, I was keeping the old value in a property and comparing this with the field value in the Valid() event to know if I have to call my method.
>
>I want to simplify this and use InteractiveChange() event.
>
>But, InteractiveChange() event is fire whenever the user press a key and not only when he exit the field. For example, the value is 33. So, after the first 3, the InteractiveChange() will be fire and also after the second one.
>
>How can I only have one call to my method without having to keep the value in a property?
>
>I can't use OLDVAL() and CURVAL() because OLDVAL() is the value when the user enter the form but might change that value more than one time before saving so OLDVAL() will not represent the actual value of the field.

To add to Arnon's idea, what I do is in the gotfocus event put in the value of the control to a variable. Then in either the lostfocus or valid events (or if you want the interactive change) compare the current value to the value stored (to a property) by the gotfocus event.

HTH
Todd Burstain, MD
infinitydoc@delphi.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform