Combobox autocomplete implementation?

S

Shakir Hussain

VM,

These are the steps to implement autocomplete

1. derive a class say "MyComboBox from ComboBox class
2. Add a member called mStringList which is an string array
3. For each new entry in combo, add it to string list.
4. On Keypress of comboBox search the string in the mStringlist and display
in combo box.
example
foreach(string str in mStringList)
{
if(str.StartsWith(cmbTest.Text) == true)
{
//fill autocomplete here.
cmbTest.Text = str;
break;
}
}


Shak.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top