Einzelnen Beitrag anzeigen

jensw_2000
(Gast)

n/a Beiträge
 
#5

Re: Alle komponenten eines typs ansprechen?

  Alt 7. Jan 2005, 22:10
So kannst du das machen ...

Delphi-Quellcode:
procedure TForm1.Irgendwas;
VAR
  I: Integer;
begin

FOR I := 0 TO form1.ControlCount - 1 DO
BEGIN
  IF (form1.Components[i] IS TLabel)THEN
  With (form1.Components[i] as TLabel) do
  begin
    Caption:='Label1234';
    color:=clRed;
  end; // with

  IF (form1.Components[i] IS TButton)THEN
  With (form1.Components[i] as TButton) do
  begin
    Caption:='Button 1234';
  end; // with


END; // for
end;

  Mit Zitat antworten Zitat