Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combo Box Problem
Message
 
À
22/10/1999 16:17:32
Jimmy Ditta
Twin City Electronics
Monroe, Louisiane, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00280197
Message ID:
00280280
Vues:
15
Ok,

First, both of th below are replacing the value in the same textbox. Thisform.txt2.

>&& BOARDFOOTAGE
>Thisform.txt2.Value = val(thisform.c11.Displayvalue) * ThisForm.lnCol2Value * ThisForm.lnCol3Value * val(thisform.c31.Displayvalue)
>
>&& LINEAL BOARDFEET
>Thisform.txt2.Value = val(thisform.c11.Displayvalue) * ThisForm.lnCol3Value * val(thisform.c31.Displayvalue)
>
>there are 3 combos, one with values 1-20, the second with the previously mentioned array, and the third with even numbers through 20.
>

I'm not exactly sure what's happening but...

Do all the combo's show a value when the form starts? If not in the init of each combo do something like:
this.value = 'SomeValueInTheList'

Now, let's move the actual calculations to a form method. In the form add a method called 'CalcBrdFeet' and 'CalcLnlFeet'. You do it the same as adding a property. Click Form, then method.

Once those are added doubleclick the form and change it to one of the methods you just added and place the code to do each calculation in it's appropriate method.

In the forms init event add the following code:
ThisForm.lnCol2Value = ThisForm.c21.aList(ThisForm.c21.ListItemID, 2)
ThisForm.lnCol3Value = ThisForm.c21.aList(ThisForm.c21.ListItemID, 3)

thisform.CalcBrdFeet()
thisform.CalcLnlFeet()
This should fill in the text boxes with the correct values at start.

In c21's IAC event put the following:
ThisForm.lnCol2Value = ThisForm.c21.aList(This.ListItemID, 2)
ThisForm.lnCol3Value = ThisForm.c21.aList(This.ListItemID, 3)

thisform.CalcBrdFeet()
thisform.CalcLnlFeet()
In c11 and c31's IAC put:
thisform.CalcBrdFeet()
thisform.CalcLnlFeet()
Now when you change any of the combos it should update the textboxes.

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