Vcl.Controls.TControl.SetZOrder
Delphi
procedure SetZOrder(TopMost: Boolean); dynamic;
C++
DYNAMIC void __fastcall SetZOrder(bool TopMost);
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
procedure function |
protected | Vcl.Controls.pas Vcl.Controls.hpp |
Vcl.Controls | TControl |
Description
Repositions the control in its parent's control list, thereby changing position onscreen.
Call SetZOrder to change the z-order of the control. To make the control the topmost control, specify the TopMost value as true. To make the control the bottommost, set TopMost to false.
After changing the order, SetZOrder invalidates the control to ensure repainting to reflect the new order.
The stacking order of windowed and non-windowed controls cannot be mingled. For example, if you put a memo, a windowed control on a form, and then put a label, a non-windowed control on top of it, the label disappears behind the memo. Windowed controls always stack on top of non-windowed controls. In this example, calling the SetZOrder method of the label or the memo has no effect; the label always remains behind the memo.