xyzDataContext dc = new xyzDataContext(); AutoCompleteStringCollection namesCollection = new AutoCompleteStringCollection(); var query = from c in dc.Clients select c.Company; foreach (String comp in query) { namesCollection.Add(comp); } tBoxCompany.AutoCompleteSource = AutoCompleteSource.CustomSource; tBoxCompany.AutoCompleteMode = AutoCompleteMode.SuggestAppend; tBoxCompany.AutoCompleteCustomSource = namesCollection;
AutoCompleteMode accept thoose values :
External link :
AutoComplete TextBox In WinForms
AutoComplete TextBox in C#
You, my friend, are a genius.
Nobody else on the interwebs even had a clue on how to achieve this little gem of a feature involving linq.
Thank you so much!
Thanks
I have search the web for a solution because I knew (deep inside me) that something should exists…
Found some sources and sample, then i made it from my own and ‘voila’…
Happy that my experience bring you some help.
Mike