將下列代碼添加到窗口加載函數中即可
AutoCompleteStringCollection collection = new AutoCompleteStringCollection();
// 獲取單位列表
List<string> unitNameList = this
foreach (string unitname in unitNameList)
{
collection
//Console
}
this
this
this
其中AutoCompleteMode包含None
None
Suggest
Append
SuggestAppend
AutoCompleteSource設置為ListItems
// 獲取單位列表
List<string> unitNameList = this
foreach (string unitname in unitNameList)
{
this
}
this
From:http://tw.wingwit.com/Article/program/net/201311/14049.html