Partager via


CSplitButton Class

The CSplitButton class represents a split button control. The split button control performs a default behavior when a user clicks the main part of the button, and displays a drop-down menu when a user clicks the drop-down arrow of the button.

class CSplitButton : public CButton

Members

Public Constructors

Name

Description

CSplitButton::CSplitButton

Constructs a CSplitButton object.

Public Methods

Name

Description

CSplitButton::Create

Creates a split button control with specified styles and attaches it to the current CSplitButton object.

CSplitButton::SetDropDownMenu

Sets the drop-down menu that is displayed when a user clicks the drop-down arrow of the current split button control.

Protected Methods

Name

Description

CSplitButton::OnDropDown

Handles the BCN_DROPDOWN notification that the system sends when a user clicks the drop-down arrow of the current split button control.

Remarks

The CSplitButton class is derived from the CButton class. The split button control is a button control whose style is BS_SPLITBUTTON. It displays a custom menu when a user clicks the drop-down arrow. For more information, see the BS_SPLITBUTTON and BS_DEFSPLITBUTTON styles in Button Styles.

The following figure depicts a dialog box that contains a pager control and a (1) split button control. The (2) drop-down arrow has already been clicked and the (3) submenu is displayed.

Dialog with a splitbutton and pager control.

Inheritance Hierarchy

CObject

CCmdTarget

CWnd

CButton

CSplitButton

Requirements

Header: afxcmn.h

This class is supported in Windows Vista and later.

Additional requirements for this class are described in Build Requirements for Windows Vista Common Controls.

See Also

Reference

CSplitButton Class

Hierarchy Chart

CButton Class