Partager via


CButton::SetSplitInfo

Specifies parameters that determine how Windows draws the current split button control.

BOOL SetSplitInfo(
     PBUTTON_SPLITINFO pInfo
);

Parameters

Parameter

Description

[in] pInfo

Pointer to a BUTTON_SPLITINFO structure that defines the current split button control.

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.

This method sends the BCM_SETSPLITINFO message, which 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.

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 changes the glyph that is used for the split button drop-down arrow. The example substitutes an up-pointing triangle glyph for the default down-pointing triangle glyph. The glyph that is displayed depends on the character that you specify in the himlGlyph member of the BUTTON_SPLITINFO structure. The down-pointing triangle glyph is specified by a character '6' and the up-pointing triangle glyph is specified by a character '5'. For comparison, see the convenience method, CButton::SetSplitGlyph.

    /* 
    The drop-down arrow glyph is a function of the specified character. 
    The default "down" drop-down arrow glyph is specified by a 
    character '6'. Set the "up" arrow glyph, which is a character '5'.
    See the convenience method, SetSplitGlyph(), for comparison.
    */
    BUTTON_SPLITINFO bsInfo = {0};
    bsInfo.mask = BCSIF_GLYPH;
    TCHAR chGlyph = _T('5'); // "up" arrow glyph 
    bsInfo.himlGlyph = (HIMAGELIST)chGlyph;
    bRC = m_splitButton.SetSplitInfo( &bsInfo );

See Also

Reference

CButton Class

Hierarchy Chart

CButton::GetSplitInfo

BCM_SETSPLITINFO

Other Resources

CButton Members