Xojo 2019R1.1 How to make all objects in a container change Visible to Not Visible

Hello all,

I’d like a checkbox to change a all other objects within the same container from Visible to Not Visible - without having to name each object and change their properties one at a time.

Is there such a method to do this?

Thanks,
Tim

You should be able to loop through all of the controls, checking if they are RectControls or DesktopUIControls and then toggle their visibility properties

Thanks Greg
Can you show a little sample code?

Tim

I’m not at home at the moment, but you should be able to

For each ctl as object in self.controls
    If ctl isa desktopuicontrol then
        DesktopUIControl(ctl).visible = false
    End if
Next

Thank you!
I appreciate the head start.

Tim

Why not just make the container Not Visible?

Because the control is inside of the container. Also, I meant Enable/Disable instead of Visible.

Same thing, if you want to disable all the controls in the container, just make the whole container Disabled.

Again Ivan,
I want only the other items to be enabled/disabled. The chkbox to enable/disable is part of the container.

If I was to remove the chkbox from the container, the rest of the form would not present well.

Tim

ahh, THAT control… :roll_eyes:

So, you dont want to hide “ALL” objects in the container as you first said…

You can put “ALL” the controls to be disabled inside another container