Einzelnen Beitrag anzeigen

alzaimar
(Moderator)

Registriert seit: 6. Mai 2005
Ort: Berlin
4.956 Beiträge
 
Delphi 2007 Enterprise
 
#7

Re: Performante Lösung gesucht (Labels füllen)!

  Alt 25. Sep 2006, 07:04
Delphi-Quellcode:
Var
  lb,lb10 : TLabel;
  s : String;
  i : Integer;

Begin
  For i:=1 to 14 do begin
    lb := FindComponent (Format('Label%d',[i])) as TLabel;
    lb10 := FindComponent (Format('Label%d',[50+i])) as TLabel;
    s := StringReplace(lb.Caption,':','',[rfReplaceAll]);
    lb10.caption := Format('%d - %s',[i,s]);
  End;
End;
Nachteil: Wenn Jemand die Komponente umbenennt, klappt das nicht mehr.
"Wenn ist das Nunstruck git und Slotermeyer? Ja! Beiherhund das Oder die Flipperwaldt gersput!"
(Monty Python "Joke Warefare")
  Mit Zitat antworten Zitat