The Root property of a control points to the uppermost Parent.
Root is of interface type IRoot. Calling GetObject on it results in the Form. The Form can be of type TCustomForm, TCustomForm3D, TForm, TForm3D, all which have TCommonCustomForm as ancestor:
function GetParentForm(Control: TFmxObject): TCommonCustomForm;
begin
if (Control.Root <> nil) and
(Control.Root.GetObject is TCommonCustomForm) then
Result := TCommonCustomForm(Control.Root.GetObject)
else
Result := nil;
end;
The
Root
property of a control points to the uppermost Parent.Root is of interface type
IRoot
. CallingGetObject
on it results in the Form. The Form can be of typeTCustomForm
,TCustomForm3D
,TForm
,TForm3D
, all which haveTCommonCustomForm
as ancestor: