Marshal
Marshal

Reputation: 6671

ComboBox AutoComplete

Is there anyway to have the autocomplete for a combo box to start from anywhere in the text, let me give you an example. If I have someone named john smith in the combobox if I start with the letter 'j' it pulls up john smith but less say I want to start with the letter 's' to search for his last name, is that possible, if so does anyone have code or a link to code that does this.

Upvotes: 3

Views: 658

Answers (1)

Christian
Christian

Reputation: 4342

The standard .NET WinForms ComboBox-control does offer auto-completition functionality for the first case you described (see the properties AutoCompleteCustomSource, AutoCompleteMode and AutoCompleteSource).

However, for your second example, you will need to implement some custom logic that will e.g. check whether the currently entered text is a subtext of an existing entry.

Upvotes: 3

Related Questions