0
我正在使用自定義自動源文本框。但問題是,當我輸入密鑰時,如果建議列表很高,那麼在顯示建議之前文本框閃爍。在c#中使用自動完成時在文本框中閃爍問題
private void txtSearch_TextChanged(object sender, EventArgs e)
{
if (txtSearch.Text != "")
{
string templateSearchTxt = txtSearch.Text;
foreach (String template in templateName) // templateName contains list of string
{
if (template.ToUpper().StartsWith(templateSearchTxt.ToUpper()))
{
suggestion.Add(template);
}
}
}
}
我已經宣佈繼形式加載事件
suggestion = new AutoCompleteStringCollection();
txtSearch.AutoCompleteCustomSource = suggestion;
txtSearch.AutoCompleteMode = AutoCompleteMode.Suggest;
txtSearch.AutoCompleteSource = AutoCompleteSource.CustomSource;
WPF?或WinForms? – code4life
我正在使用WinForms – user1622088