Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Best practice – Form Calculations
Message
De
01/05/2005 05:15:02
 
 
À
01/05/2005 03:03:05
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01009973
Message ID:
01009979
Vues:
29
For this purpose, Bindevent is perfect!
In the textbox where you want the result, I call it txtResult, you have something like this in the Refresh:
This.value=this.parent.txtMyValue1.value + this.parent.txtMyValue2.value + this.parent.txtMyValue3.value
Add these lines to your form, for instance in the Gotfocus method:
Bindevent(thisform.txtMyValue1,"interactivechange",thisform.txtResult,"refresh")
Bindevent(thisform.txtMyValue2,"interactivechange",thisform.txtResult,"refresh")
Bindevent(thisform.txtMyValue3,"interactivechange",thisform.txtResult,"refresh")
Then whenever you change any of the values in txtMyValue1, txtMyValue2 or txtMyValue3, txtResult will also get updated.

>How do you experts implement form calculations? What I mean by this is, a form has several numeric fields and I want to make calculations based on these fields and display the results on the form, updating the results every time there is a change.
>
>When the form is displayed, it should calculate and display the results. When there are any changes in the numeric fields it should recalculate and display the results.
>
>In that I am not much of a programmer, the more specific the answer the better.
>
>Thanks.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform