K kozen Unregistered / Unconfirmed GUEST, unregistred user! 2001-06-07 #1 请问如何在程序运行时向一个Form中添加Button?
X xiao_min Unregistered / Unconfirmed GUEST, unregistred user! 2001-06-07 #2 var mybutton:tbutton; begin mybutton:=tbutton.create(form); with mybutton do begin parent:=form; height:=32; width:=128; caption:='new button'; left:=0; top:=0; end; end;
var mybutton:tbutton; begin mybutton:=tbutton.create(form); with mybutton do begin parent:=form; height:=32; width:=128; caption:='new button'; left:=0; top:=0; end; end;
W wind_cloudy Unregistered / Unconfirmed GUEST, unregistred user! 2001-06-07 #3 var mybutton:Tbutton; ... mybutton:=Tbutton.create(self);//创建 //设置属性 mybutton.left:=20; mybutton.top:=20; mybutton.width:=120; mybutton.caption:='动态按钮'; mybutton.parent:=self;//使其可见 //将MYONCLICK过程赋给onclick事件 mybutton.onclick:=myOnclick;
var mybutton:Tbutton; ... mybutton:=Tbutton.create(self);//创建 //设置属性 mybutton.left:=20; mybutton.top:=20; mybutton.width:=120; mybutton.caption:='动态按钮'; mybutton.parent:=self;//使其可见 //将MYONCLICK过程赋给onclick事件 mybutton.onclick:=myOnclick;
P panyongze Unregistered / Unconfirmed GUEST, unregistred user! 2001-06-07 #4 procedure TForm1.FormCreate(Sender: TObject); begin with TButton.Create(Form1) do begin Parent := Form1; Caption := '确 定'; Left := 32; Top := 80; end; end;
procedure TForm1.FormCreate(Sender: TObject); begin with TButton.Create(Form1) do begin Parent := Form1; Caption := '确 定'; Left := 32; Top := 80; end; end;