https://docwiki.embarcadero.com/RADStudio/Sydney/en/Attributes_(RTTI)
Rtti.TRttiType (Delphi)
procedure TForm1.FormCreate(Sender: TObject);
var
LContext: TRttiContext;
LType: TRttiType;
LMethod: TRttiMethod;
LProperty: TRttiProperty;
LField: TRttiField;
LTreeNode1, LTreeNode2: TTreeNode;
begin
LContext := TRttiContext.Create;
try
LType := LContext.GetType(TButton);
LTreeNode1 := TreeView1.Items.AddChild(nil, LType.ToString);
LTreeNode2 := TreeView1.Items.AddChild(LTreeNode1, 'Methods');
for LMethod in LType.GetMethods do
begin
TreeView1.Items.AddChild(LTreeNode2, LMethod.ToString);
end;
LTreeNode2 := TreeView1.Items.AddChild(LTreeNode1, 'Properties');
for LProperty in LType.GetProperties do
begin
TreeView1.Items.AddChild(LTreeNode2, LProperty.ToString);
end;
LTreeNode2 := TreeView1.Items.AddChild(LTreeNode1, 'Fields');
for LField in LType.GetFields do
begin
TreeView1.Items.AddChild(LTreeNode2, LField.ToString);
end;
TreeView1.FullExpand;
finally
LContext.Free;
end;
end;
Rtti.TRttiType (Delphi)