const length=10;
var
 btn:array[0..10] of Tbutton;
begin
  for 
   begin
    btn[i]:=tbutton.create(self);
    btn[i].x =
    btn[i].y =
    btn[i].parent =
    btn[i].caption := inttostr(i);
  end;
......

解决方案 »

  1.   

    不懂你的意思了.是动态CREATE button吗?
    ...............
    public 
     button:array[0..100]of tbutton;
    ..............
    procedure CreateButton;
    var
    i;integer;
    begin
     for i:= 0 to 100 do
    begin
      button[i]:=tbutton.create(form1);
    with button[i] do
    begin
     parent:=form1;
     width:=100;
    height:=30;
     caption:='button'+inttostr(i);end;
    end;
    end;
      

  2.   

    不太敢肯定
    好像是
    var
    button:array of Tbutton;
    procedure..........
    begin
    for I:=0 to n do 
    begin
    button[i].create(form1);
    button[i].parent(form1);
    END;
    END;
      

  3.   

    不需动态创建,你做好后可以直接这样访问
    Var
      loop,i :integer;
    begin
    i :=0;
    for loop := 0 to ComponentCount-1 do//遍历全部组件
      if (Components[loop] is TButton) then//判断是否是TButton
      begin
        i := i + 1;
        (Componets[loop] as TButton).Caption := IntToStr(i);
      end;
    end;
      

  4.   

    设置button控件的TAg值,然后在一个buttonClick事件中写代码,根据:
    TButton(Sender).tag的值进行判断!
    if tag=1 then TButton(Sender).caption:='';
    祝你好运!