none
c# comboBox总是触发SelectIndexChange事件? RRS feed

答案

  • 你好,

    我测试一下comboBox_SelectedIndexChanged事件。实际情况是选择相同的item,这个事件还是会触发的。我的测试代码如下:

    private void comboBox2_SelectedIndexChanged(object sender, EventArgs e)
            {
                MessageBox.Show("Event Happens");
            }

    测试结果是选择相同的item也会触发此事件。


    Paul Zhou [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • 已标记为答案 Paul Zhou 2011年4月8日 2:46
    2011年4月4日 6:49

全部回复

  • 什么类库的combobox啊?C#类库很多的,Windows Forms, ASP.Net, WPF, Silverlight, XNA...

    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    2011年3月31日 16:56
    版主
  • windows forms
    2011年4月1日 2:46
  • 你好,

    我测试一下comboBox_SelectedIndexChanged事件。实际情况是选择相同的item,这个事件还是会触发的。我的测试代码如下:

    private void comboBox2_SelectedIndexChanged(object sender, EventArgs e)
            {
                MessageBox.Show("Event Happens");
            }

    测试结果是选择相同的item也会触发此事件。


    Paul Zhou [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • 已标记为答案 Paul Zhou 2011年4月8日 2:46
    2011年4月4日 6:49