Oder alternativ sowas?
(nur hingedaddelt und nicht getestet)
Delphi-Quellcode:
for i := 0 to ComponentCount - 1 do begin
if Components[i] is TPanel then begin
case TPanel(Components[i]).Tag of
1 : TPanel(Components[i]).Caption := '1';
2 : TPanel(Components[i]).Caption := '2';
...
end;
end;
end;
oder
Delphi-Quellcode:
for i := 0 to ComponentCount - 1 do begin
if Components[i] is TPanel then begin
with Components[i] as TPanel do begin
case Tag of
1 : Caption := '1';
2 : Caption := '2';
...
end;
end;
end;
end;