I have created a Combo box with the 3 items.
And one more Combo Box with the 9 items.
When one item of 1st combo box selected,the 2nd combo box should show only 3 items out of 9 items.
how to do this?
I tried but not getting it.

6 Years
Discussion Span
Last Post by Reverend Jim

here is in example :

  1. in ComboBox1 Properties i put this item :

  2. in ComboBox1 SelectedIndexChanged event, i put this code :

        Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
        If Me.ComboBox1.Text = "Superhero" Then
            With Me.ComboBox2
            End With
        ElseIf Me.ComboBox1.Text = "Badguy" Then
            With Me.ComboBox2
                .Items.Add("Lex Luthor")
            End With
        End If
    End Sub

Beats me. I tried your example (except that I factored out ".Items" to give)

With ComboBox2.Items

etc. and it works, Sorry I took so long to respond. We got to the the cottage last weekend and I didn't get my internet hooked up until this morning.

When you say you put "Superhero" and "Bad Guy" in properties, you do mean into the Items collection, correct?

Edited by Reverend Jim: added details

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.