Thema: Delphi Indiziert Labels

Einzelnen Beitrag anzeigen

Benutzerbild von Der.Kaktus
Der.Kaktus

Registriert seit: 22. Jan 2008
Ort: Erfurt
958 Beiträge
 
Delphi 7 Enterprise
 
#2

Re: Indiziert Labels

  Alt 6. Apr 2008, 07:36
Gibt es...

z.B.:

Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var z,i:integer;
    a:Array[0..10] of TComponent; // mal als Beispiel nur 11
begin
 z:=-1;
 For i:=0 to form1.ComponentCount-1 do
 begin
  if (form1.Components[i] is TLabel) then
  begin
    inc(z);
    a[z]:=form1.Components[i];
  end;
 end;
 For i:=0 to z do (a[i] as TLabel).Caption:=IntTostr(i); //Bsp. Caption fuellen
end;
Gruss Kaki

Repeat Until true=false;
  Mit Zitat antworten Zitat