Einzelnen Beitrag anzeigen

Hallo_Thomas

Registriert seit: 18. Apr 2005
Ort: Dresden
405 Beiträge
 
Delphi 2005 Professional
 
#1

Eine Schleife für die Labels mit Variablenzuordnung(Array)?

  Alt 3. Mai 2005, 14:42
Ich habe jetzt schon eine versuche hintermir, haber wie schaffe ich es unten den Text zsammenzufassen?



die Lange Form
Delphi-Quellcode:
       Form1.Label192.Caption:= IntToStr(Counte[0]) ;
       Form1.Label193.Caption:= IntToStr(Counte[1]) ;
       Form1.Label194.Caption:= IntToStr(Counte[2]) ;
       Form1.Label195.Caption:= IntToStr(Counte[3]) ;
       Form1.Label196.Caption:= IntToStr(Counte[4]) ;
       Form1.Label197.Caption:= IntToStr(Counte[5]) ;
       Form1.Label198.Caption:= IntToStr(Counte[6]) ;
       Form1.Label199.Caption:= IntToStr(Counte[7]) ;
       Form1.Label200.Caption:= IntToStr(Counte[8]) ;
       Form1.Label201.Caption:= IntToStr(Counte[9]) ;
Mein Fehlgeschlagener versuch, da ändert sich im Label gar nix:
Delphi-Quellcode:
begin
 for x:=0 to 9 do
  for i:=192 to 201 do
(FindComponent('form1.Label'+IntToStr(i)) as TLabel).Caption:=IntToStr(Counte[x]);
  Mit Zitat antworten Zitat