dimitarberbatov
New member
- Joined
- Nov 11, 2008
- Messages
- 2
- Programming Experience
- Beginner
Hi I'm building a cash register and need some. I need help with adding my TotalCost together, I need to add ExtBurger, ExtFries and ExtDrink together to get my total, but not sure which event will need to trigger.
here is a sample of my code:
I need to add ExtBurger, ExtFries and ExtDrink together to get a total and display it in lblTotal
If anyone could point me in the right direction on which event will need to trigger the calulation, where to declare the variables etc?
any help would be brilliant
thanks
here is a sample of my code:
VB.NET:
Private Sub VScrollBar1_Scroll(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ScrollEventArgs) Handles VScrollBar1.Scroll
lblQtyBurger.Text = VScrollBar1.Value
Dim BurgerPrice As Decimal
Dim ExtBurger As Decimal
BurgerPrice = 1.44
ExtBurger = VScrollBar1.Value * BurgerPrice
lblBurgerPrice.Text = BurgerPrice
lblExtBurger.Text = ExtBurger
VB.NET:
Private Sub VScrollBar2_Scroll(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ScrollEventArgs) Handles VScrollBar2.Scroll
lblQtyFries.Text = VScrollBar2.Value
Dim FriesPrice As Decimal
Dim ExtFries As Decimal
FriesPrice = 0.74
ExtFries = VScrollBar2.Value * FriesPrice
lblFriesPrice.Text = FriesPrice
lblExtFries.Text = ExtFries
End Sub
VB.NET:
Private Sub VScrollBar3_Scroll(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ScrollEventArgs) Handles VScrollBar3.Scroll
lblQtyDrink.Text = VScrollBar3.Value
Dim DrinkPrice As Decimal
'Dim ExtDrink As Decimal
DrinkPrice = 0.66
ExtDrink = VScrollBar3.Value * DrinkPrice
lblDrinkPrice.Text = DrinkPrice
lblExtDrink.Text = ExtDrink
End Sub
If anyone could point me in the right direction on which event will need to trigger the calulation, where to declare the variables etc?
any help would be brilliant
thanks
Last edited by a moderator: