我有一個班級根據傳遞給它的文本返回Google建議的列表。我的問題是:搜索建議API和自動完成TextBox的
How can I use this class to work as an AutoCompleteCustomSource for a textbox tool so user can write text in it and that text sent to this class to bring a list of Suggestions as user is writing and every litter that user add will be added to the text which will be sent again to the class to bring more Suggestions?
例如,這個調用這個類的填充textbox1
基於建議名單「的Arduino」詞:
SearchSuggestionsAPI search = new SearchSuggestionsAPI();
IList result = (await search.GetSearchSuggestions("arduino"));
for (int i = 0; i < result.Count; i++)
{
string sent = result[i].ToString();
textBox1.AutoCompleteCustomSource.Add(result[i].ToString());
textBox1.AppendText(sent);
textBox1.AppendText(Environment.NewLine);
}
可能重複[自動完成文本框控件](https:// stackoverflo w.com/questions/1357853/autocomplete-textbox-control) – Sinatr