//按钮的top,left,height,width属性,名称和标题属性以及父控件
procedure TForm1.AddBtn(ai_top,ai_left,ai_Height,ai_width:integer;as_name,as_caption:string;ai_par:TWinControl);
begin
with TButton.Create(ai_par) do
begin
left := ai_left;
top := ai_top;
Parent := ai_par; //iobj_PControl 这表示你这个控件放在谁上面
Width := ai_width ;
Height := ai_Height;
Caption := as_caption;
Font.Charset := ANSI_CHARSET;
Font.Color := clNavy;
Font.Height := -13;
Font.Name := '宋体';
Font.Style := [];
ParentFont := False;
TabOrder := 0;
name := as_name;
OnClick := BtnClick;
end;
end;
procedure TForm1.AddBtn(ai_top,ai_left,ai_Height,ai_width:integer;as_name,as_caption:string;ai_par:TWinControl);
begin
with TButton.Create(ai_par) do
begin
left := ai_left;
top := ai_top;
Parent := ai_par; //iobj_PControl 这表示你这个控件放在谁上面
Width := ai_width ;
Height := ai_Height;
Caption := as_caption;
Font.Charset := ANSI_CHARSET;
Font.Color := clNavy;
Font.Height := -13;
Font.Name := '宋体';
Font.Style := [];
ParentFont := False;
TabOrder := 0;
name := as_name;
OnClick := BtnClick;
end;
end;