BOOL Create( DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID );
Return Value
Nonzero if successful; otherwise 0.
Parameters
dwStyle
Specifies the style of the checklist box. The style must be either LBS_OWNERDRAWFIXED (all items in the list are the same height) or LBS_OWNERDRAWVARIABLE (items in the list are of varying heights). This style can be combined with other list-box styles.
rect
Specifies the checklist-box size and position. Can be either a CRect object or a RECT structure.
pParentWnd
Specifies the checklist box’s parent window (usually a CDialog object). It must not be NULL.
nID
Specifies the checklist box’s control ID.
Remarks
You construct a CCheckListBox object in two steps. First define a class derived from CCheckListBox, then call Create, which initializes the Windows checklist box and attaches it to the CCheckListBox. See CCheckListBox::CCheckListBox for a sample.
When Create executes, Windows sends the WM_NCCREATE, WM_CREATE, WM_NCCALCSIZE, and WM_GETMINMAXINFO messages to the checklist-box control.
These messages are handled by default by the OnNcCreate, OnCreate, OnNcCalcSize, and OnGetMinMaxInfo member functions in the CWnd base class. To extend the default message handling, add a message map to the your derived class and override the preceding message-handler member functions. Override OnCreate, for example, to perform needed initialization for a new class.
Apply the following window styles to a checklist-box control:
CCheckListBox Overview | Class Members | Hierarchy Chart
See Also CCheckListBox::CCheckListBox