Share via


CButton::SetSplitSize

Sets the bounding rectangle of the drop-down component of the current split button control.

BOOL SetSplitSize(
     LPSIZE pSize
);

Parameters

Parameter

Description

[in] pSize

Pointer to a SIZE structure that describes a bounding rectangle.

Return Value

true if this method is successful; otherwise, false.

Remarks

Use this method only with controls whose button style is BS_SPLITBUTTON or BS_DEFSPLITBUTTON.

When the split button control is expanded, it can display a drop-down component such as a list control or pager control. This method specifies the size of the bounding rectangle that contains the drop-down component.

This method initializes the mask member of a BUTTON_SPLITINFO structure with the BCSIF_SIZE flag and the size member with the pSize parameter, and then sends that structure in the BCM_GETSPLITINFO message that is described in the Windows SDK.

Requirements

Header: afxwin.h

This method is supported in Windows Vista and later.

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

Example

The following code example defines the variable, m_splitButton, that is used to programmatically access the split button control. This variable is used in the following example.

public:
    // Variable to access programatically defined command link control.
    CButton m_cmdLink;
    // Variable to access programatically defined split button control. 
    CButton m_splitButton;

The following code example doubles the size of the split button drop-down arrow.

    // Double the size of the split button drop-down arrow.
    SIZE sz;
    bRC = m_splitButton.GetSplitSize( &sz ); // current size
    sz.cx = sz.cx * 2;
    sz.cy = sz.cy * 2;
    bRC = m_splitButton.SetSplitSize( &sz );

See Also

Reference

CButton Class

Hierarchy Chart

CButton::GetSplitSize

Other Resources

CButton Members