Please help me.
I want to attach listbox to textbox.Listbox has items added into them,when i enter char on textbox then similar items in listbox will be shown as like dropdown and we can select item using arrow keys.List box size should increases dynamically.
Attach listbox to textbox
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Hemant SrivastavaRank #581 · 4.2K reputationPosted Nov 13, 2013, 4:31 AM EST
private void txtBx_TextChanged(object sender, EventArgs e)
{
// Clear the selection for every new character entered
cmbBx.SelectedItem = null;
// get the list from ComboBox
var itemList = cmbBx.Items;
// Iterate each element in the comboBox to check which element has TextBox substring
foreach(var item in itemList)
{
if (item.ToString().Contains(txtBx.Text))
{
// If found show that item on the ComboBox and exit the loop
cmbBx.SelectedItem = item;
break;
}
}
}
If it helps you, please mark it accepted answer.