procedure TForm1.Button1Click(Sender: TObject);
var
TName : Tclass;
begin
ListBox1.Clear;
RegisterClasses([TButton,TEdit,TListBox,TRadioButton, TPanel]); //要先注册类,才能使用GetClass
TName := GetClass(Edit1.Text);
while TName<>nil do
begin
ListBox1.Items.Add(TName.ClassName);
TName := TPersistentClass(TName.ClassParent);
end;
end;
由类名获取父类-delphi
最新推荐文章于 2020-11-27 19:49:24 发布