Search code examples
delphic++buildertcheckbox

Change CheckBox state without calling OnClick Event


I'm wondering so when I change state of CheckBox

CheckBox->Checked=false;

It calls CheckBoxOnClick Event , how to avoid it ?


Solution

  • 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.