Jamo
Jamo

Reputation: 3258

Controlling z-axis / bring-to-front at runtime (Delphi)

In Delphi, how do you control a visual control's z-axis position at runtime? e.g. How, programmatically and at runtime, do you accomplish the equivalent of (from the IDE main menu) "Edit -> Bring to Front" at designtime?

Upvotes: 17

Views: 9468

Answers (2)

Henk Holterman
Henk Holterman

Reputation: 273794

TControl.BringToFront; will usually do it.

Upvotes: 21

Toon Krijthe
Toon Krijthe

Reputation: 53476

Just to add some information.

Controls are created in order (in the dfm file). The last control overlaps the first if they share part of the window. You can change the order by changing the order of the controls in the dfm file.

At runtime, you can change the order in the control list. But BringToFront will do this for you.

Upvotes: 11

Related Questions