ComboBox TextUpdate事件

winfrom ComboBox TextUpdate事件 首次输入词组(广州)会触发2次,最后text= "州",有人知道原因么?怎么解决! 大哥帮帮忙!
输入法 换了 也一样,第一次输入“广州”,事件会分开2次触发,最后文本框得出的结果只有“州”字,后续怎么输入都正常,就是第一次出现问题!

cbxSchool.TextUpdate += (a, b) =>
{
var input = cbxSchool.Text.ToUpper();
if (!string.IsNullOrEmpty(input))
{
cbxSchool.Items.Clear();
var newList = generalSchoolViewModel.Where(x => x.GeneralSchoolName.IndexOf(input, StringComparison.CurrentCultureIgnoreCase) != -1).ToArray();
cbxSchool.Items.AddRange(newList);
}
cbxSchool.Select(cbxSchool.Text.Length, 0);
cbxSchool.DroppedDown = true;
//保持鼠标指针形状
cbxSchool.Cursor = Cursors.Default;
};

TextUpdate事件导致

change在焦点失去以后才会激发,update你每次更新text,输入或者选择新项的时候都会激发

原文地址:https://www.cnblogs.com/Echo529/p/6382219.html