基本上在下面的代码中,我试图通过数组循环,如果组合框中的当前文本不匹配数组中的任何东西,它会引发错误。但是我无法让它触发事件TextChanged事件。组合框C#的TextChanged事件#
任何帮助是极大的赞赏在属性窗口
string[] SRtier1 = { "Option1", "Option2", "Option3", "Option4", "Option5" };
private void SRcmb_tier1_TextChanged(object sender, EventArgs e)
{
//Loop SRtier1 Array to ComboBox
for (int i = 0; i < SRtier1.Length; i++)
{
if (SRcmb_tier1.Text != SRtier1[i])
{
MessageBox.Show("Please select one of the options provided.");
}
}
}
仔细检查您的组合框是否与属性窗口中的“SRcmb_tier1_TextChanged”事件绑定。 – 2015-02-11 10:46:33