Jump to content

Help with updating Form in real time with radio buttons

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
4 replies to this topic

#1
juniordee

juniordee

    Newbie

  • Members
  • Pip
  • 9 posts
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.

#2
Vswe

Vswe

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 9,552 posts
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
juniordee

juniordee

    Newbie

  • Members
  • Pip
  • 9 posts
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...

#4
Vswe

Vswe

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 9,552 posts
I can't help you more without any code since that will update it with the correct code :)

#5
juniordee

juniordee

    Newbie

  • Members
  • Pip
  • 9 posts
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