关于CheckBox的CheckedChanged事件,在窗体LOAD时他也会触发此事件,我要怎样才能在load方法时不触发此事件,急!
解决方案 »
- richTextBox中选中的字体显示红色遇到问题
- 关于boxing 与unboxing 的疑问。
- Type t = Type.GetType("System.Drawing.Point");为何为NULL?
- 初学C# 不知道这段代码哪里有毛病,调用时总是outOfMemory
- 关于C#正则表达式:运行后eachEntryList3.Count的值为啥是0
- SQL 多个表的查询
- 求教 将截断字符串或二进制数据。语句以终止.
- ++++++++简单问题高手请来,如何把.cs类做成dll,调用????+++++++
- 当鼠标进入指定范围时变手行
- 请问在c#里能够编写一个像tcpdump/windump的程序吗?
- 关于dataset插入提交到数据库的问题
- 请问 如何用 C# 向 access 的表中 插入(修改) 和 读取 类型为OLE对象(以图片为例吧)的字段 ?
二、在类里定义一个标志变量,事件里检查,跳过第一次调用。第一种方法最好!checkBox1.ItemCheck -= new EventHandler(checkBox1_ItemCheck);//Add
........
checkBox1.ItemCheck += new EventHandler(checkBox1_ItemCheck);//Add
一、在Form_Load里添加数据前先注销事件,处理完再注册事件;
二、在类里定义一个标志变量,事件里检查,跳过第一次调用。第一种方法最好!checkBox1.ItemCheck -= new EventHandler(checkBox1_ItemCheck);//Add
........
checkBox1.ItemCheck += new EventHandler(checkBox1_ItemCheck);//Add
checkBox1.ItemCheck += new EventHandler(checkBox1_ItemCheck);//Add
啊
{
checkBox1.ItemCheck -= new EventHandler(checkBox1_ItemCheck);//Add........//添加值、赋值等操作checkBox1.ItemCheck += new EventHandler(checkBox1_ItemCheck);//Add
}
checkBox1.ItemCheck += new EventHandler(checkBox1_ItemCheck);
加到form1_Load(...)里,去掉构造函数中的那个。