CHeaderCtrl::Create

BOOL Create( DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID );

Return Value

Nonzero if initialization was successful; otherwise zero.

Parameters

dwStyle

Specifies the header control’s style. Apply any combination of header control styles needed to the control.

rect

Specifies the header control’s size and position. It can be either a CRect object or a RECT structure.

pParentWnd

Specifies the header control’s parent window, usually a CDialog. It must not be NULL.

nID

Specifies the header control’s ID.

Remarks

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

The following styles can be applied to a header control (see About Header Control Styles for more information):

In addition, you can use the following common control styles to determine how the header control positions and resizes itself (see Common Control Styles for more information):

You can also apply the following window styles to a header control (see Window Styles for more information):

Example

// pParentWnd is a pointer to the parent window.
extern CWnd* pParentWnd;
// The pointer to my header control.
extern CHeaderCtrl* pmyHeaderCtrl;

pmyHeaderCtrl->Create(WS_CHILD|WS_VISIBLE|HDS_HORZ,
   CRect(10, 10, 600, 50), pParentWnd, 1);

CHeaderCtrl OverviewClass MembersHierarchy Chart

See Also   CHeaderCtrl::CHeaderCtrl