Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# winforms combobox dynamic autocomplete

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; 
like image 561
algreat Avatar asked Aug 02 '12 15:08

algreat


1 Answers

I also came across these kinds of requirements recently. I set the below properties without writing the code and it works. See if this helps you.

AutoCompleteMode: SuggestAppend // AutoCompleteSource: ListItems // DropDownStyle: DropDownList

like image 159
Devanathan.S Avatar answered Sep 21 '22 02:09

Devanathan.S