问题描述
我想改变复选框值不提高的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 statementsor any other work arounds.I am looking for a cleaner ways for it.
推荐答案
您可以从CheckBox类派生,覆盖的并没有调用基类的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.
这篇关于更改复选框值而不筹款活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!