Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 955
Jamo Avatar asked Jul 11 '09 07:07

Jamo


2 Answers

TControl.BringToFront; will usually do it.

like image 83
Henk Holterman Avatar answered Sep 25 '22 11:09

Henk Holterman


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.

like image 29
Toon Krijthe Avatar answered Sep 25 '22 11:09

Toon Krijthe