C# winforms combobox dynamic autocomplete

algreat picture algreat · Aug 2, 2012 · Viewed 123.5k times · Source

My problem is similar to this one: How can I dynamically change auto complete entries in a C# combobox or textbox? But I still don't find solution.

The problem briefly:

I have an ComboBox and a large number of records to show in it. When user starts typing I want to load records that starts with input text and offer the user for autocomplete. As described in the topic above I can't load them on сomboBox_TextChanged because I always overwrite the previous results and never see them.

Can I implement this using only ComboBox? (not TextBox or ListBox)

I use this settings:

сomboBox.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
сomboBox.AutoCompleteSource = AutoCompleteSource.CustomSource;

Answer

Devanathan.S picture Devanathan.S · Jan 4, 2017

I Also come across these kind of requirements recently.I set the below properties with out writing the code it works.see if this helps you.

enter image description here