Combo box keyup event
first on form load i used the a method to bind the datatable to combobox
when i select using dropdown that is okey but i want to use while typing automatically bind with the control.
first on form load i used the a method to bind the datatable to combobox
when i select using dropdown that is okey but i want to use while typing automatically bind with the control.
Correct me if I'm answering the wrong question, but I believe you want to know how to know when the user changes a dropdown value based on text they type in. E.g. if I have "dogs", "cats", "mice" in a dropdown, I type in "d" and "dogs" gets selected.
To do this, first you need to set the DropDownStyle property of the combobox to DropDownList. Now typing will autoselect values.
Then you can hook the SelectedItemChanged event - this tells you that the selected item has changed, no matter if it's changed by the mouse or the keyboard.
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged 'write code here to access data using ComboBox1.Text End Sub |
Hope this helps. Best,
Paul Yuknewicz
Visual Basic