> Does someone know how to get the ancestor of a class say:
> GetAncestor(TPanel) would be TCustomPanel??

TObject has a class method ClassParent

So for

procedure ShowComponentParent( C :TComponent );
begin
  showmessage(C.ClassType.ClassParent.ClassName);
end;

if you've already got the class type then

TheClass.ClassParent returns the TClass that was inherited from.

--
Aaron Scott-Boddendijk
Jump Productions
(07) 838-3371 Voice
(07) 838-3372 Fax


---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to