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:
-
LVS_ALIGNLEFT Specifies that items are left-aligned in icon and small icon view.
-
LVS_ALIGNTOP Specifies that items are aligned with the top of the control in icon and small icon view.
-
LVS_AUTOARRANGE Specifies that icons are automatically kept arranged in icon view and small icon view.
-
LVS_EDITLABELS Allows item text to be edited in place. The parent window must process the LVN_ENDLABELEDIT notification message.
-
LVS_ICON Specifies icon view.
-
LVS_LIST Specifies list view.
-
LVS_NOCOLUMNHEADER Specifies that a column header is not displayed in report view. By default, columns have headers in report view.
-
LVS_NOLABELWRAP Displays item text on a single line in icon view. By default, item text can wrap in icon view.
-
LVS_NOSCROLL Disables scrolling. All items must be within the client area.
-
LVS_NOSORTHEADER Specifies that column headers do not work like buttons. This style is useful if clicking a column header in report view does not carry out an action, such as sorting.
-
LVS_OWNERDRAWFIXED Enables the owner window to paint items in report view. The list view control sends a WM_DRAWITEM message to paint each item; it does not send separate messages for each subitem. The itemData member of the DRAWITEMSTRUCT structure contains the item data for the specified list view item.
-
LVS_REPORT Specifies report view.
-
LVS_SHAREIMAGELISTS Specifies that the control does not take ownership of the image lists assigned to it (that is, it does not destroy the image lists when it is destroyed). This style enables the same image lists to be used with multiple list view controls.
-
LVS_SHOWSELALWAYS Always show the selection, if any, even if the control does not have the focus.
-
LVS_SINGLESEL Allows only one item at a time to be selected. By default, multiple items can be selected.
-
LVS_SMALLICON Specifies small icon view.
-
LVS_SORTASCENDING Sorts items based on item text in ascending order.
-
LVS_SORTDESCENDING Sorts items based on item text in descending order.
CListCtrl Overview | Class Members | Hierarchy Chart
See Also CListCtrl::CListCtrl