chrisryhal
asked on
Declare Combobox Collection????
How can I declare a "collection" for a combobox?
Example:
Dim JobsCollection As String = Handwork,Routing,Engineeri ng,CADCAM
Only reason I ask, if because I have two comboboxes on my Windows App form. I will need to fill combobox2 based on the value of what combobox1 is
Example:
Dim JobsCollection As String = Handwork,Routing,Engineeri
Only reason I ask, if because I have two comboboxes on my Windows App form. I will need to fill combobox2 based on the value of what combobox1 is
What do you mean by collection because you can just do this
Private Sub ComboBox1_SelectedIndexCha nged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexCha nged
ComboBox2.Items.Add(ComboB ox1.Select edItem)
End Sub
Private Sub ComboBox1_SelectedIndexCha
ComboBox2.Items.Add(ComboB
End Sub
the above code will add the item you have selected in combobox1 to combobox2
or if you only want to add after the user pressed on ok button, then just put that code in the button click event
or if you only want to add after the user pressed on ok button, then just put that code in the button click event
ASKER
Here is what I am trying to achieve more in detail.
If user chooses "Part" in Combo1 then Combo2 fills with:
Raw Material
Dies
IT Equipment
Machining Equipment
If user chooses "Customer" in Combo1 then Combo2 fills with:
Stanley
Black and Decker
J&L Tooling
Snap-On
And so on
If user chooses "Part" in Combo1 then Combo2 fills with:
Raw Material
Dies
IT Equipment
Machining Equipment
If user chooses "Customer" in Combo1 then Combo2 fills with:
Stanley
Black and Decker
J&L Tooling
Snap-On
And so on
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
These strings you want to put in combobox2 where do they come from ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Allong with that, here is what I am trying to achieve:
If ComboBox1.SelectedItem = "Jobs" Then
ComboBox2.Collection = STRING