如题@_@

解决方案 »

  1.   

    Var:
      a:Tbutton;
    begin
      a:=Tbutton.Create(self);
      a.parent:=Panel1;
    end;
      

  2.   

    指定owner,从TWinControl继承的要指定parent
      

  3.   

    Var:
      a:Tbutton;
    begin
      a:=Tbutton.Create(self);
      a.parent:=form1;
      a.top=100;
      a.left=100;
      a.height=20;
      a.width=120;end;
      

  4.   

    如动态添加按钮:var
      button1:tbutton;
    begin
      button1:=tbutton.create(self);
      with button1 do
      begin
        Parent:=form1;
        top:=50;
        left:=50;
        width:=50;
        caption:='test';
      end;
    end;
      

  5.   

    with TButton.Create(Self) do
      begin
        Name := Button1 ;
        Top := 10 ;
        Left := 10 ;
        Width := 10 ;
        Height := 10 ;
        Parent := Form1 ;
      end;