Change CheckBox state without calling OnClick Event

后端 未结 8 1759
时光取名叫无心
时光取名叫无心 2021-01-04 06:35

I\'m wondering so when I change state of CheckBox

CheckBox->Checked=false;

It calls CheckBoxOnClick Event , how to avoid it ?

8条回答
  •  臣服心动
    2021-01-04 07:03

    You could surround the onClick event code with something like

    if myFlag then
      begin
        ...event code...
      end;
    

    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.

提交回复
热议问题