for i:=0 to componentcount-1 do
begin if components[i] is edit then
tedit(components[i]).text:='';
//加分

解决方案 »

  1.   

    type Edtest=array[0..9]of Tedit;
    ...
    for i:=0 to 9 do
    begin
    strs.add(edtest[i].text);
    end;
    以上是创建了一个新类,可以用Honey_001的方法较简单.
      

  2.   

    strs:=Tstringlist.create;
    for i:=0 to self.ComponentCount-1 do
      if self.Components[i].ClassType=TEdit then
        strs.Add(TEdit(Components[i]).Text);
      

  3.   

    haoco(Lot)和honey_001(小小文) 最理想!!
      

  4.   

    strs:=Tstringlist.create;
    for i:=1 to 10 do
    strs.Add(TEdit(FindComponent('Edit'+IntToStr(i))).text);
      

  5.   

    haoco(Lot)和honey_001(小小文) 最理想
      

  6.   

    DELPHI里不好用控件姐的,要用就用顶楼的那个方法for i:=0 to components.count-1 do
       begin
       if (components[i].is tedit then
          begin
          tedit(components[i]).setfocus;
         ^^^^^^^^^^^
          end;
       end;
      

  7.   

    private
      FEdits: array [0..9] of TEdit;
    onCreate;
      FEdits[0] := Edit1;
      FEdits[1] := Edit2;
      ...use
    for I ;= 0 to High(FEdits) do
      ShowMessage(FEdits[I].Text);  
      

  8.   

    我用的是copy_paste(木石三) 那种方式,挺好用的,不过我用的是指针
      

  9.   

    这样行不?
    var
     sList:TStrings;
     i:integer;
    begin
    sList:=TStringList.create; for i:=0 to form1.controls.count-1 do 
    begin
     if form1.controls[i].classtype=tedit then 
     sList.addobject(Form1.controls[i]ClassName,TEdit(FOrm1.controls[i]));
    end;
    end;
    在用的时候
    Tedit(sList.object[1]).text:='ddd';
      

  10.   

    用的时候tedit(slist.objects[i]).text:='ddd';