ComboBox Help
-
I've got three comboboxes. ComboBox1 has two selections, (a) and (b). I can't figure out how to go about to pick one and driving ComboBox2. I'd like to pick (a) from ComboBox1 and have ComboBox2 know that when I pick (a), the associated data selections would be selectable in this ComboBox. Both (a) and (b)have specific data tied to each of them and I need it to know how to differentiate. When I pick from ComboBox2, this will also drive what I can select in ComboBox3, but I need help getting started first. Thanks.
-
I've got three comboboxes. ComboBox1 has two selections, (a) and (b). I can't figure out how to go about to pick one and driving ComboBox2. I'd like to pick (a) from ComboBox1 and have ComboBox2 know that when I pick (a), the associated data selections would be selectable in this ComboBox. Both (a) and (b)have specific data tied to each of them and I need it to know how to differentiate. When I pick from ComboBox2, this will also drive what I can select in ComboBox3, but I need help getting started first. Thanks.
-
In this event of combobox1 'combobox1_selectedindexchanged' determine which was selected and call the appropriate routine to load/replace the contents of combobox2.
Thanks. I hate to ask too much, but I am rusty (2 years since coding of any form). Could you please explain "which was selected and call the appropriate routine to load/replace the contents of combobox2"? I appreciate the help.
-
Thanks. I hate to ask too much, but I am rusty (2 years since coding of any form). Could you please explain "which was selected and call the appropriate routine to load/replace the contents of combobox2"? I appreciate the help.
When the event fires, you need to check combo1 for what the user selected. Then react accordingly. There are 3 properties you can check to do this. Once you know what they selected, then call the appropriate routine to load the correct values in combo2 that belong to the selection they made in combo1 the properties: Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged Select Case ComboBox1.SelectedIndex 'if you hardcoded the contents of combo1 Case 0 Call FillCombo2WithATypes() Case 1 Call FillCombo2WithBtypes() End Select Select Case ComboBox1.SelectedText 'what they see in the combo list Case "A - type " Call FillCombo2WithATypes() Case "B - type " Call FillCombo2WithBtypes() End Select Select Case ComboBox1.SelectedValue 'the code for what they see Case "A" Call FillCombo2WithATypes() Case "B" Call FillCombo2WithBtypes() End Select End Sub