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.
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:
Code: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
I did try that, but for some reason it didn't work
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...
I can't help you more without any code since that will update it with the correct code![]()
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!![]()
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks