J jinglong Unregistered / Unconfirmed GUEST, unregistred user! 2005-11-21 #1 怎样动态创建一个button并设置他的一些属性呢
J jinglong Unregistered / Unconfirmed GUEST, unregistred user! 2005-11-21 #2 怎样动态创建一个button并设置他的一些属性呢
B bjaman Unregistered / Unconfirmed GUEST, unregistred user! 2005-11-21 #3 var Button1 : TButton; Button1 := TButton.Create(nil); try Button1.Parent := Self; Button1.Caption := '我的按钮'; Button1.Font.Size := 14; ................. Button1.OnClick := 我的方法过程; finally FreeAndNil(Button1); end;
var Button1 : TButton; Button1 := TButton.Create(nil); try Button1.Parent := Self; Button1.Caption := '我的按钮'; Button1.Font.Size := 14; ................. Button1.OnClick := 我的方法过程; finally FreeAndNil(Button1); end;
X xianguo Unregistered / Unconfirmed GUEST, unregistred user! 2005-11-21 #4 procedure TForm1.Button1Click(Sender: TObject); var Button2 : TButton; begin Button2 := TButton.Create(Application); Button2.Parent := Self; Button2.Caption := 'TEST'; end;
procedure TForm1.Button1Click(Sender: TObject); var Button2 : TButton; begin Button2 := TButton.Create(Application); Button2.Parent := Self; Button2.Caption := 'TEST'; end;