Layering Objects

Suppose I have 6 (overlapping) objects - lets just say rectangles - on a window.
Is there a way (when program is running) to adjust which rectangle is overlapping which rectangle?
In other words, change the layering of the rectangles.

Thanks!

Because there are no control properties for this, I believe that layering (or ordering) of controls can only be managed in the Layout editor using the provided editor buttons. So layering is a design-time feature.

I think the only other way is to create your controls at runtime, using AddControl and in the order you want for layering, i.e., first control is at the bottom, last control added is at the top(?)

Note: I have not tested this workaround.

1 Like

Yeah what you’re asking to do is to change the z-order, which as far as I understand it, can’t be done in Xojo. As @Scott_C mentioned, you’ll have to remove the old rectangle and create it again, at which point it will be on top.

2 Likes

Have a look at this conversation

Overlapping controls. Just say no.

2 Likes