【发布时间】:2011-08-19 17:07:15
【问题描述】:
我的 winforms 应用程序中有一个 ListBox,我需要处理 ItemChecked,因为每次用户单击项目时我都需要一些东西。问题是我还需要在表单的其他一些事件中更改 Checked 属性。在这些情况下,我需要避免这样做。
例子:
private void listBox1_ItemChecked(object sender, ItemCheckedEventArgs e)
{
if (true) //Should check if item was clicked.
{
//Do some stuff
}
else //If the event was fired because I changed the Checked property from the code
{
//Do some other stuff
}
}
谢谢
【问题讨论】:
标签: c# .net winforms events listbox