Autor Beitrag
Freiberger
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 130

WIN XP
Delphi 7
BeitragVerfasst: So 18.11.07 15:31 
Hallo,
wie kann ich feststellen, ob eine Komponente zb die Eigenschaft ".Font" oder ".Text" hat.
Ich möchte alle Komponenten meiner Form durchlaufen, und wenn es eine bestimmte Eigenschaft gibt, dann soll diese geändert werden.
Man könnte es ja so machen...

FOR t = 0 to Form1.componencount-1 do begin
if Form1.component[t] is TLabel then TLabel( Form1.component[t] ).Font := .....

* hier sollte stehen...
* wenn Komponente hat Eigenschaft "Font", dant Komponente.Font =...
end;

...ich möchte aber einfach alle Komponenten mit der Eigenschaft finden, egal Ob TLabel oder TEdit usw.
Gibt es da ne Möglichkeit ???
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: So 18.11.07 15:36 
Schau Dir dazu einfach mal die Unit TypInfo an. Damit kannst Du auf die RTTI aller Komponenten zugreifen ...

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
Freiberger Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 130

WIN XP
Delphi 7
BeitragVerfasst: So 18.11.07 15:50 
ok, ich versuche es mal...

Super, es klappt...
DANKESCHÖN... :D