Advertisement
Guest User

Untitled

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