unit Unit1; interface uses System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, FMX.Types, FMX.Graphics, FMX.Controls, FMX.Forms, FMX.Dialogs, FMX.StdCtrls, FMX.Layouts, FMX.TreeView; type TTest = class(TTreeViewItem) end; type TTest2 = class(TTest) end; type TTest3 = class(TTest2) end; type TTestLabel = class(TLabel) end; type TTestLabel2 = class(TTestLabel) end; type TForm1 = class(TForm) TreeView1: TTreeView; Panel1: TPanel; procedure FormCreate(Sender: TObject); private { Private declarations } public { Public declarations } testvar1: TTest; testvar2: TTest2; testvar3: TTest3; testvar4: TLabel; testvar5: TTestLabel; testvar6: TTestLabel2; end; var Form1: TForm1; implementation {$R *.fmx} procedure TForm1.FormCreate(Sender: TObject); var i: Integer; begin testvar1 := TTest.Create(Form1); testvar1.Parent := TreeView1; testvar1.Text := 'TESTing Tree 1'; testvar2 := TTest2.Create(Form1); testvar2.Text := 'TESTing Tree 2 - not working'; testvar2.Parent := TreeView1; testvar3 := TTest3.Create(Form1); testvar3.Parent := TreeView1; testvar3.Text := 'TESTing Tree 3 - not working'; testvar4 := TLabel.Create(Form1); testvar4.Parent := Panel1; testvar4.Align := TAlignLayout.Bottom; testvar4.Text := 'TESTing Label 1'; testvar5 := TTestLabel.Create(Form1); testvar5.Parent := Panel1; testvar4.Align := TAlignLayout.Bottom; testvar5.Text := 'TESTing Label 2'; testvar6 := TTestLabel2.Create(Form1); testvar6.Parent := Panel1; testvar4.Align := TAlignLayout.Bottom; testvar6.Text := 'TESTing Label 3 - not working'; end; end.