다음을 통해 공유


CComboBoxEx::Create

Creates the combo box and attaches it to the CComboBoxEx object.

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

Parameters

  • dwStyle
    Specifies the combination of combo box styles applied to the combo box. See Remarks below for more information about styles.

  • rect
    A reference to a CRect object or RECT structure, which is the position and size of the combo box.

  • pParentWnd
    A pointer to a CWnd object that is the parent window of the combo box (usually a CDialog). It must not be NULL.

  • nID
    Specifies the combo box's control ID.

Return Value

Nonzero if the object was created successfully; otherwise 0.

Remarks

Create a CComboBoxEx object in two steps:

  1. Call CComboBoxEx to construct a CComboBoxEx object.

  2. Call this member function, which creates the extended Windows combo box and attaches it to the CComboBoxEx object.

When you call Create, MFC initializes the common controls.

When you create the combo box, you can specify any or all of the following combo-box styles:

  • CBS_SIMPLE

  • CBS_DROPDOWN

  • CBS_DROPDOWNLIST

  • CBS_AUTOHSCROLL

  • WS_CHILD

All other styles passed when you create the window are ignored. The ComboBoxEx control also supports extended styles that provide additional features. These styles are described in ComboBoxEx control extended styles, in the Windows SDK. Set these styles by calling SetExtendedStyle.

If you want to use extended windows styles with your control, call CreateEx instead of Create.

Requirements

Header: afxcmn.h

See Also

Reference

CComboBoxEx Class

Hierarchy Chart

CComboBoxEx::CComboBoxEx

Other Resources

CComboBoxEx Members