0

Hi,

I am building my first VB2008 application and I am trying to figure out a way to make some check boxes being checked when an entry from a combo box is selected on top of these check boxes. More specific, I am trying to describe the services offered in 3 hotel room types. i.e. If the user selects from the combo box the room type "Economy" some extras will be automatically checked (TV, mini bar, etc). If the user selects "Premium" some more check boxes will be checked. That's the idea.

Any help would be greatly appreciated.

Thanks.

2
Contributors
2
Replies
4
Views
7 Years
Discussion Span
Last Post by manowar666
0

Go to the ComboBox1_SelectedIndexChanged event, and add an if-statement similar to the one below:

If ComboBox1.SelectedItem = "Economy" Then
            CheckBox1.Checked = True
            CheckBox2.Checked = True
            CheckBox3.Checked = False
            CheckBox4.Checked = False
            CheckBox5.Checked = False
        ElseIf ComboBox1.SelectedItem = "Premium" Then
            CheckBox1.Checked = True
            CheckBox2.Checked = True
            CheckBox3.Checked = True
            CheckBox4.Checked = False
            CheckBox5.Checked = False
        ElseIf ComboBox1.SelectedItem = "Executive" Then
            CheckBox1.Checked = True
            CheckBox2.Checked = True
            CheckBox3.Checked = True
            CheckBox4.Checked = True
            CheckBox5.Checked = True
End If

I must say, if you need help with something so simple, you really have problems, if took like 1 minute to make a simple program like this.

0

First of all thank you. It worked like a charm :)

Second, regarding the "problems" comment, I have to say that is my first time programming on VB, and I am trying to finish a project that my part is only the UI. I just needed the code above in order for a colleague of mine to grasp the idea of my UI when I sent it to him.

Thanks though once again.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.