使用循环完成:
for i ;= 1 to 30 do
begin
  TEdit(findcomponent('edit' + inttostr(i))).text := i;
end;

解决方案 »

  1.   

    Type
      TForm1...
      public
        EditList:TStringList; 
      end;
    ....
    TForm1.Form1Create(Sender:TObject);
    var
      iCount:Integer;
    begin
      EditList := TObjectList.Create; 
      for iCount := 0 to ComponentCount - 1 do
      begin
        if Components[iCount] is TEdit then
        begin
          EditList.Add(Components[iCount]);
        end;
      end;
    end;/////////////////////////
    //可以用了,知道怎么用吗?
    /////////////////////////TForm1.Form1Destroy(Sender:TObject);
    begin
     //如果
     EditList.Free; 
    end;
    好像不怎么全
      

  2.   

    谢谢GreensPan,cobi解决了我一部分问题,你解决了我全部问题,谢谢二位!
      

  3.   

    for i ;= 1 to 30 do
    begin
      TEdit(findcomponent('edit' + inttostr(i))).text := i;//没有Edit1会出错
    end; 
      

  4.   

    //正确的是
    var
      vComponent: TComponent;
      I: Integer;
    begin
      for I ;= 1 to 30 do begin
        vComponent := FindComponent('Edit' + IntToStr(I));
        if Assigned(vComponent) then TEdit(vComponent).Text := StrToInt(I);
      end; 
    end;
      

  5.   

    //正确的是
    var
      vComponent: TComponent;
      I: Integer;
    begin
      for I ;= 1 to 30 do begin
        vComponent := FindComponent('Edit' + IntToStr(I));
        if Assigned(vComponent) then TEdit(vComponent).Text := StrToInt(I);
      end; 
    end;