CListCtrl::Create

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

Return Value

Nonzero if successful; otherwise zero.

Parameters

dwStyle

Specifies the list control’s style. Apply any combination of list control styles to the control. See the Remarks section for a list of possible styles.

rect

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

pParentWnd

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

nID

Specifies the list control’s ID.

Remarks

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

The dwStyle parameter can be a combination of the following values:

Example

// pParentWnd is a pointer to the parent window.
extern CWnd* pParentWnd;
// The pointer to my list view control.
extern CListCtrl* pmyListCtrl;

pmyListCtrl->Create(
   WS_CHILD|WS_VISIBLE|WS_BORDER|LVS_REPORT,
   CRect(10,10,400,200), pParentWnd, 1);

CListCtrl OverviewClass MembersHierarchy Chart

See Also   CListCtrl::CListCtrl