更改复选框值而不筹款活动 [英] Change Checkbox value without raising event

查看:104
本文介绍了更改复选框值而不筹款活动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想改变复选框值不提高的oncheck事件。
我知道有变通像未登记的基础上,标志更改值然后重新登记,
的内部事件的方法要么跳过或评估方法报表
或任何其他变通。
我找了它一个更清洁的方式。

I want to change Checkbox value without raising the onCheck event. I know there are work arounds like un registering ,changing the value then re- registering, Inside the event method based on flag either skip or evaluating the method statements or any other work arounds. I am looking for a cleaner ways for it.

推荐答案

您可以从CheckBox类派生,覆盖的 CheckBox.OnCheckedChanged方法并没有调用基类的OnCheckedChanged方法和事件不会被解雇。您也可以指示事件是否应提高与否的属性。

You can derive from CheckBox class, override CheckBox.OnCheckedChanged Method and do not call the base class's OnCheckedChanged method and the event will not be fired. You can also have a property which indicates whether the event should be raised or not.

这篇关于更改复选框值而不筹款活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆