Bring a control to front in runtime

Is it possible to move a control to front in Runtime?

I have a control array of Canvases. And a canvas I use as a drag promise, snapping to a grid. But when I move, the dragged control is always in the back of the others. Even when I bring it to front in the IDE.

If it can’t be done the normal way, is there a Declare that can help out?

Under Windows, SetWindowPos() can do it. Note that in spite of the name, it works on controls. See WFS.

Not aware of anything like that for Mac or Linux.

That refers to a Windows Declare, right?
I work on a Mac. Maybe there is a Mac declare out there… :confused:

Not to my knowledge, no. And I looked for it.

Your best option is to use dynamic controls, the last one coming on top.

Tried that. But the controls are of different types. And that doesn’t work.

What do you mean, a “different type” ? Arent’you confusing with ContainerControls ? Canvases and other controls in a control set can be created by new at any time. It would mean refactoring code, and copying properties eventually.

The thing is, as much as I would like to say “yes, here is a declare”, it simply does not seem to exist (never say never). You will have to cleverly make due with what is available.