简体   繁体   中英

Autocomplete a textbox in c#

I'm trying to autocomplete a textbox. I'm retrieving values from Access Database. Just one field from a data table. If anyone can help me.

AutoCompleteStringCollection autoCompleteList = 
                                            new AutoCompleteStringCollection();
/* copy your datacolumn in to autoCompleteList iteratively here */
txtBox.AutoCompleteMode = AutoCompleteMode.SuggestAppend; /* or just Suggest */
txtBox.AutoCompleteCustomSource = autoCompleteList;

如果使用c#应用程序,则可以在应用程序中使用控件。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM