Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.             Dim index As Integer
  2.             index = comboBox1.FindString(textBox2.Text)
  3.             comboBox1.SelectedIndex = index
  4.  
  5.             comboBox1.BeginUpdate()
  6.             Dim I As Integer
  7.             For I = 0 To 1000
  8.                 comboBox1.Items.Add("Item 1" + i.ToString())
  9.             Next
  10.             comboBox1.EndUpdate()
  11.  
  12.             Dim selectedIndex As Integer
  13.             selectedIndex = comboBox1.SelectedIndex
  14.             Dim selectedItem As Object
  15.             selectedItem = comboBox1.SelectedItem
  16.  
  17.             MessageBox.Show("Selected Item Text: " & selectedItem.ToString() &  Microsoft.VisualBasic.Constants.vbCrLf & _
  18.                                 "Index: " & selectedIndex.ToString())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement