I understand what you are trying to do, and it makes sense that you want it to work that way. However, here is a workaround for how it works.
You can also update other controls in OnUpdate . You are not limited to updating a control that receives a notification. Thus, in action for a control that defines visibility, you can set the visibility of other controls there. In your case, this checkbox:
Create a new action (Action2) and assign it to the checkbox.
Then in the checkbox action OnUpdate:
procedure TForm1.Action2Update(Sender: TObject); begin Button1.Visible := TAction(Sender).Checked; end;
Be sure to check the OnExecute box. Something simple, how wonderful it is:
procedure TForm1.Action2Execute(Sender: TObject); begin TAction(Sender).Checked := not TAction(Sender).Checked; end;
For me, this still makes logical sense. You can look in one place to see all the controls whose visibility depends on the checkbox selected.
Marcus adams
source share