954,514 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

list box displayed in combo box

I have a list box with 5 selections. when and item in the list box is selected i want a combo box to populate with different selection. any ideas on how to get the combo box to populate?

ng5
Light Poster
41 posts since Dec 2011
Reputation Points: 19
Solved Threads: 0
 

I created a listbox and a combobox. I populated the listbox with the words (one per line) "the quick brown fox jumped over the lazy dog". I then added an event handler as follows:

Private Sub ListBox1_SelectedValueChanged(sender As Object, e As System.EventArgs) Handles ListBox1.SelectedValueChanged

    ComboBox1.Items.Clear()

    For i As Integer = 1 To ListBox1.Text.Length
        ComboBox1.Items.Add(Mid(ListBox1.Text, i, 1))
    Next

End Sub

Selecting a word in the listbox will causes the letters of that word to be put into the combobox. Is that what you are looking for?

Reverend Jim
Posting Shark
Moderator
1,167 posts since Aug 2010
Reputation Points: 253
Solved Threads: 159
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: