Combo box keyup event

Anyone can help me, on my form i used combox control for selctionChangeCommitted the action is fine but i want to use keyup event that will search for an existing datatable bind to :

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.

[371 byte] By [merwinp] at [2008-2-13]
# 1
Hi,

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

PaulYuk_MS at 2007-8-21 > top of Msdn Tech,Visual Basic,Visual Basic General...