I am working on a project for my programming course. We have to make a form that will order pizzas. We have size, type, toppings, and cost. Cost is done by having labels that will change it's text values depending on the toppings (check boxes), size and type (radio buttons).
Now my question is, when I use the example .exe that we have to replicate, I change the toppings, size, etc and the cost changes with the selections in real time. But with the program I wrote, I have to wait till I press a button before it changes. How do I make it update in real time?
I'm sure it's something really simple.
Thanks.
Help with updating Form in real time with radio buttons
Started by juniordee, Mar 09 2010 09:10 PM
4 replies to this topic
#1
Posted 09 March 2010 - 09:10 PM
|
|
|
#2
Posted 10 March 2010 - 12:09 AM
Instead of having an event handling the button's click you should add it to your radio buttons and check boxes' checkedchanged event, like so:
Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged, RadioButton2.CheckedChanged, CheckBox1.CheckedChanged, CheckBox2.CheckedChanged 'etc.
'your code goes here instead
End Sub
#3
Posted 10 March 2010 - 12:27 AM
I did try that, but for some reason it didn't work :confused:
EDIT: Ok I tried again, and it only updates the size, and not the price (but it's all in the same piece of code?).
I made a refresh button and included the same sub in it, and it updates everything when I use the button. But I want it to update when I select the radio buttons and check the checkboxes...
EDIT: Ok I tried again, and it only updates the size, and not the price (but it's all in the same piece of code?).
I made a refresh button and included the same sub in it, and it updates everything when I use the button. But I want it to update when I select the radio buttons and check the checkboxes...
#4
Posted 10 March 2010 - 09:04 AM
I can't help you more without any code since that will update it with the correct code :)
#5
Posted 10 March 2010 - 04:48 PM
Well, turns you were right. I probably did something wrong earlier but I tried again (for a 3rd time) and it does exactly what I want it to do. Thanks!:P


Sign In
Create Account

Back to top









