이런식으로 코딩하시면..^^
procedure TForm1.Button1Click(Sender: TObject);
var
i: integer;
Count: Integer;
begin
Count := 1;
for i := 0 to Self.ComponentCount - 1 do
if Components[i].ClassName = 'TLabel' then begin
TLabel(Components[i]).Caption := IntToStr(Count);
inc(count);
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
i: integer;
Count: Integer;
begin
Count := 1;
for i := 0 to Self.ComponentCount - 1 do
if Components[i].ClassName = 'TLabel' then begin
TLabel(Components[i]).Caption := IntToStr(Count);
inc(count);
end;
end;