64,654
社区成员
发帖
与我相关
我的任务
分享
CButton::Create
BOOL Create( LPCTSTR lpszCaption, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID );
Return Value
Nonzero if successful; otherwise 0.
Parameters
lpszCaption
Specifies the button control’s text.
dwStyle
Specifies the button control’s style. Apply any combination of button styles to the button.
rect
Specifies the button control’s size and position. It can be either a CRect object or a RECT structure.
pParentWnd
Specifies the button control’s parent window, usually a CDialog. It must not be NULL.
nID
Specifies the button control’s ID.
nID 为UINT类型,即无符号的整形数
Example
CButton myButton1;
// Create a push button.
myButton1.Create(_T("My button"), WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON,
CRect(10,10,100,30), pParentWnd, 1);
也可以向楼上那样定义