Solved

COMPONENT HIERARCHY

Posted on 2002-05-22
1
370 Views
Last Modified: 2010-04-04
COMPONENT HIERARCHY

How to know component hierarchy ?

For example : TLabel
-----
TObject
TPersistent
TComponent
TControl
TWidgetControl
TFrameControl
TCustomLabel
TLabel
-----

Thanks.
0
Comment
Question by:cvbmn
1 Comment
 
LVL 27

Accepted Solution

by:
kretzschmar earned 350 total points
ID: 7028233
from the delphi help file:

This example shows how to obtain the ancestry of a component using the ClassType and ClassParent properties.  It uses a button and a list box on a form. When the user clicks the button, the name of the button’s class and the names of its parent classes are added to the list box.

procedure TForm1.Button1Click(Sender: TObject);

var
  ClassRef: TClass;
begin
  ListBox1.Clear;
  ClassRef := Sender.ClassType;
  while ClassRef <> nil do
  begin
    ListBox1.Items.Add(ClassRef.ClassName);
    ClassRef := ClassRef.ClassParent;
  end;

end;

The list box contains the following strings after the user clicks the button:

TButton
     TButtonControl
     TWinControl
     TControl
     TComponent
     TPersistent
     TObject

meikl ;-)
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now