Hi!
I am working on an application and need some help with comboboxes. In my form I have three comboboxes. When I select something in the first combobox, I want certain values to be added to the second combobox. Now, if I select one of the loaded values in the second combobox, I want certain values to be added to the third combobox. I have tried using both If-else and Cases, but nothing seems to work. Here's an example of my problem;
When I start the program, various music genres are loaded into ComboBox1.
Code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ListGenre()
ListArtist()
ListAlbum()
End Sub
Public Sub ListGenre()
ComboBox1.Items.Add("Rock")
ComboBox1.Items.Add("Punk")
End Sub
If I select for example "Rock", I want ComboBox2 to load these values;
Code:
Public Sub ListArtist()
Select Case ComboBox1.SelectedIndex
Case "Rock"
ComboBox2.Items.Add("Band1")
ComboBox2.Items.Add("Band2")
End Select
End Sub
And once i select one of the values in ComboBox2, I want ComboBox3 to load these values;
Code:
Public Sub ListAlbum()
Select Case ComboBox2.SelectedIndex
Case "Band1"
ComboBox3.Items.Add("Album1")
ComboBox3.Items.Add("Album2")
End Select
End Sub
I hope I made myself somewhat understandable. Is this possible in some way? I'm obviously not doing right, so help would be much appreciated!