Solved

component properties

Posted on 2001-07-01
2
189 Views
Last Modified: 2010-04-06
How can i see on runTime list of component properties
0
Comment
Question by:asi
2 Comments
 
LVL 8

Accepted Solution

by:
Cesario earned 30 total points
ID: 6243887
Hi asi

this small application list all Properties for a given Component.


unit Unit21;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls;

type
  TForm1 = class(TForm)
    ListBox1: TListBox;
    procedure FormCreate(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

uses TypInfo;

procedure ObjectInspector(
  Obj   : TObject;
  Items : TStrings );
var
  n        : integer;
  PropList : TPropList;
begin
  n := 0;
  GetPropList(
    Obj.ClassInfo,
    tkProperties + [ tkMethod ],
    @PropList );
  while( (Nil <> PropList[ n ]) and
         (n < High(PropList)) ) do
  begin
    Items.Add(
      PropList[ n ].Name + ': ' +
      PropList[ n ].PropType^.Name );
    Inc( n );
  end;
end;


procedure TForm1.FormCreate(Sender: TObject);
begin
  // List the Listbox Properties
  ObjectInspector( ListBox1, ListBox1.Items );
end;

Best Regards

Cesario

end.
0
 

Author Comment

by:asi
ID: 6244100
I didn't test it but its look promises ...
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

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…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

760 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

18 Experts available now in Live!

Get 1:1 Help Now