"stay on top" controls

How can I make a control stay on top of others dynamically by code ? I need something like zorder from VB6.

Apart from declares, I do not see anything in Xojo.

But you can always have a control come on top by creating it dynamically. I just tried cloning a rectangle so it comes over an oval with

dim r as new Rectangle1 //Rectangle1 is a control set

Putting controls on top of other controls is a recipe for making your UI flicker like mad
I’d suggest NOT doing it

[quote=144735:@Norman Palardy]Putting controls on top of other controls is a recipe for making your UI flicker like mad
I’d suggest NOT doing it[/quote]
I’ve seen this response before to this question and as a result have always done my best to avoid putting controls on top of other controls. But, just out of curiosity (it’s always easier for me to accept things unconditionally if I actually understand “the why” behind them), why would VB6 even have that capability (z order of controls) if the end result is “mad flickering”? I understand this might be a stupid DUH question to those of you who know the answer inside out, but humor/educate me … what’s the difference between VB6 and Xojo on this?

VB had a level of support from MS that we don’t so they could do tricks to make it not flicker that don’t exist for us.
They also tended to NOT use OS drawn controls but did their own custom drawing.
They’re known as self drawn controls which lets you do things to reduce flicker.

Thank you, Norman … much obliged for your explanation. Now, at least I can explain that to someone else if I’m asked.

fyi I was trying to build a custom button…then I realized I could just use bevel buttons;
problem solved.
Xojo delivers

I came from Visual Basic 12 years ago when it was still Real Basic. Although Xojo looks very familiar, I found that the best way to program in Xojo is to try to forget the VB way, and embrace the Xojo philosophy.

As I posted, there is indeed a way to overcome the absence of zorder, but it does not work at all the same. And Norman justly warned that it would flicker.

Sometimes, it is better to go for the final goal (the button), and concentrate less on the journey. You can do custom buttons with Canvases too and use the MouseDown event in lieu of Action.

Glad to read you found a solution.