var commdxdb:array[0..12] of tdxdbedit
for i:=0 to 12 do
 begin
   commdxdb[i]:=tdxdbedit.create(self);
 end;
也可以使用动态数组吧,具体的没试过,
指针是肯定可以的
 var p:^tdxdbedit;
 var tlist1:tlist;
 tlist1:=tlist.create();
 while true do
  begin
   new(p);
   p^:=tdxdbedit.create(self);
   p.parent:=self;
   p.top:=34;
   p.bottom:=45;
   tlist1.add(p);
   
  end;

解决方案 »

  1.   

    for i:=0 to form1.ControlCount-1 do
    begin
      if controls[i].ClassType =TEdit then TEdit(controls[i]).ReadOnly:=false;
      if controls[i].ClassType =TMaskEdit then TMaskEdit(controls[i]).ReadOnly :=false;
      if controls[i].classType=Tcombobox then TCombobox(controls[i]).Enabled :=true;
      if controls[i].ClassType=Tradiobutton then TradioButton(controls[i]).Enabled :=true;
     end;
     end;
    这样要可以了吧
      

  2.   

    for i:=0 to ComponentCount-1 do
    begin
       if (Components[i] is Tdxdbedit) then 
       ....//处理
    end;
    如果你想按一定的顺序,请设置Tdxdbedit的tag值,其余的自己想办法吧(你一定能行)!
      

  3.   

    dxdbe1,dxdbe2,..dxdbe6的Tag为1,2,..6  
    var 
    commdxdb: tdxdbedit; 
    i,j:integer;for i:=1 to 6 do
    begin
       commdxdb:=tdxdbedit.create(application);
       for j:=0 to form.ComponentCount-1 do
        if form.Components[j].ClassName=tdxdbedit then
          if form.Components[j].Tag=i then
            commdxdb:=form.componets[j];end;
      

  4.   

    for i:=1 to form1.controlcount-1 do
    begin
      ....
       commdxdb:=tdxdbedit.create(application);
       if form1.controls[i].classType=tdxdbedit then 
       commdxdb:=TdxDbedit(controls[i]);
      。
      
    end;
      

  5.   

    tygh2000(峰) 同志: 你误解我的意思了,我那6个控件已经创建好的了,我只要从循环语句中取出对应控件,也就是当i:=1时,commdxdb这个控件实例代表的是dxdbe1,当i:=2时,commdxdb这个控件实例代表的是dxdbe2,当i:=3时,commdxdb这个控件实例代表的是dxdbe3,以此类推.
    这样我应该如何实现或是用别的方法也行,请你再多多指教!!
      

  6.   

    for i := 1 to 6 do
      commdxdb.text := Tdxdbedit(findcomponent('dxdb'+inttostr(i))).text;
      

  7.   

    commdxdb := Tdxdbedit(findcomponent('dxdb'+inttostr(i)));
      

  8.   

    呵呵,IDLE_(阿呆)的行得通,我试过了!