更改复选框状态,而不调用OnClick事件 [英] Change CheckBox state without calling OnClick Event
本文介绍了更改复选框状态,而不调用OnClick事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想知道如何更改CheckBox的状态
I'm wondering so when I change state of CheckBox
CheckBox->Checked=false;
它调用CheckBoxOnClick Event,如何避免?
It calls CheckBoxOnClick Event , how to avoid it ?
推荐答案
您可以围绕onClick事件代码,如
You could surround the onClick event code with something like
if myFlag then
begin
...event code...
end;
如果您不希望执行,请将myFlag设置为false,并在复选框状态更改后将其设置为true。
If you don't want it to be executed, set myFlag to false and after the checkbox state's change set it back to true.
这篇关于更改复选框状态,而不调用OnClick事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文