set selected item in combobox - vb.net

后端 未结 1 1757
猫巷女王i
猫巷女王i 2021-02-08 13:04

I am using this code to add a value to a combobox different then the one displayed: how to add value to combobox item

Lets suppose i have 3 values in my Combobox:

<
1条回答
  •  醉梦人生
    2021-02-08 13:35

    solved this way:

    Private Sub ComboBox1_Keyup(sender As Object, 
      e As System.Windows.Forms.KeyEventArgs) Handles ComboBox1.KeyUp
    
          ComboBox1.SelectedIndex = ComboBox1.FindStringExact(ComboBox1.Text)
    
    End Sub
    

    0 讨论(0)
提交回复
热议问题