var
  i :integer;
begin
  for i := 0 to form1.component.count-1 do  
   if form1.components[i] is Tlabel then 
   showmessage(TLabel(form1.Components[i]).Caption);
end;

解决方案 »

  1.   

    更正
    form1.component.count-1 ->form1.ComponentCount-1
      

  2.   

    for i:= 1 to 10 do
    begin
        if FindComponents('Label'+Inttostr(i)) Is TLabel then
        begin
           TLabel(FindComponents('Label'+Inttostr(i))).Caption := 'aa';
        end;
    end;
      

  3.   

    for i:= 1 to 10 do
    begin
    if FindComponents('Label'+Inttostr(i)) Is TLabel then
     begin
     TLabel(FindComponents('Label'+Inttostr(i))).Caption := 'aa';
     end;
    end;
      

  4.   

    liujc(阿聪) (  )
    经典
      

  5.   

    procedure TForm1.FormCreate(Sender: TObject);
    var
      i:integer;
    begin
       for i:= 1 to 10 do
         begin
           if Form1.FindComponent('Label'+Inttostr(i)) Is TLabel then
             begin
               TLabel(Form1.FindComponent('Label'+Inttostr(i))).Caption := 'aa';
             end;
        end;
    end;
      

  6.   

    或者自己定义Tobject数组 
    MyLabel:array[1..10]of Tobject;
    然后使用Tcomponent(Mylabel[i])循环即可!