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.

Remarks

You construct a CButton object in two steps. First call the constructor, then call Create, which creates the Windows button control and attaches it to the CButton object.

If the WS_VISIBLE style is given, Windows sends the button control all the messages required to activate and show the button.

Apply the following window styles to a button control:

CButton OverviewClass MembersHierarchy Chart

See Also   CButton::CButton