简体   繁体   English

Delphi FMX-控件的绘画顺序

[英]Delphi FMX - control paint order of controls

I want to control the order of paint each of the control at the form. 我想控制窗体上每个控件的绘制顺序。

I know that I can control it at the design move and it actually change creation order of controls at the form. 我知道我可以在设计移动时对其进行控制,并且实际上它可以更改表单中控件的创建顺序。

But is there way to change that at runtime? 但是有办法在运行时更改它吗?

You'll probably find it depends on the order of the items in the parent objects Children list. 您可能会发现它取决于父对象“子级”列表中各项的顺序。 There are various functions for managing the children of an object: 有多种功能可管理对象的子代:

public
    //Returns the component we are a child of, which may not be the immediate parent
    function GetParentComponent: TComponent; override;
    function HasParent: Boolean; override;
    procedure AddObject(const AObject: TFmxObject);
    procedure InsertObject(Index: Integer; const AObject: TFmxObject);
    procedure RemoveObject(const AObject: TFmxObject); overload;
    procedure RemoveObject(Index: Integer); overload;
    function ContainsObject(AObject: TFmxObject): Boolean; virtual;
    procedure Exchange(const AObject1, AObject2: TFmxObject); virtual;
    procedure DeleteChildren;
    function IsChild(AObject: TFmxObject): Boolean; virtual;
    //Front and back (first and last) of Children list
    procedure BringToFront; virtual;
    procedure SendToBack; virtual;
    procedure AddObjectsToList(const AList: TFmxObjectList);
    procedure Sort(Compare: TFmxObjectSortCompare); virtual;
    property ChildrenCount: Integer read GetChildrenCount;
    property Children: TFmxChildrenList read FChildrenList;
    property Parent: TFmxObject read FParent write SetParent;
    //a.k.a. Parent.Children.IndexOf(Self)
    property Index: Integer read GetIndex write SetIndex; 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM