Hi all,
I am trying to teach myself the basics of programming before I take a course involved in it. I have been working through some sample pieces and i was wondering if someone could help me out with a little bit of code.
basically the problem i have is using check boxes. I want to select a certain amount of ice cream toppings and I have each check box done separately.
basically in the code for each text box i have this
i figured doing this for each would allow me to raise a running total (totalToppings)Code:Private Sub chkSprinkles_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkSprinkles.CheckedChanged If chkSprinkles.Checked Then totalToppings += 1 End If totalToppings += 0 End Sub
since each topping costs one dollar i have the totalToppings incrementing when each one is ticked. I want to then display this total in a text box.
I assumed it was something like this. would this not display the total in the text box
thanks alotCode:Private Sub toppingPrice_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles toppingPrice.TextChanged toppingPrice.Text = totalToppings End Sub




Reply With Quote