tags:

views:

33

answers:

1

Is there any built-in or easy way to add autocomplete and persistence to a combobox (like in a browser)?

It would also be great if users could delete entries (also present in most browsers)?

Basically, the user would type in a command, then type in another one and also be able to use the dropdown (or Suggest/SuggestAppend) to grab any previous commands.

+1  A: 

I don't think there is a control to do everything you want, but the built-in TextBox control in WinForms does support auto-complete.

TextBox textBox = new TextBox();
textBox.AutoCompleteCustomSource.AddRange(new string[]
{
    "Value1",
    "Value2",
    "Value3",
    // etc..
});
textBox.AutoCompleteMode = AutoCompleteMode.Suggest;
textBox.AutoCompleteSource = AutoCompleteSource.CustomSource;

Find some more info on MSDN. You may be able to find 3rd party controls that have more complete functionality.

Fara