共用方式為


CButton::SetSplitStyle

設定目前分割按鈕控制項的樣式。

BOOL SetSplitStyle(
     UINT uSplitStyle
);

參數

參數

描述

[in] uSplitStyle

分割按鈕樣式的位元組合。 如需詳細資訊,請參閱 BUTTON_SPLITINFO 結構的 uSplitStyle 成員。

傳回值

true ,如果此方法成功,否則, false。

備註

使用這個方法與按鈕樣式是 BS_SPLITBUTTON 或 BS_DEFSPLITBUTTON的控制項。

分割按鈕樣式指定視窗繪製分割按鈕圖示的對齊、外觀和圖形格式。 如需詳細資訊,請參閱 BUTTON_SPLITINFO 結構的 uSplitStyle 成員。

這個方法會在 BUTTON_SPLITINFO 結構的 mask 成員與 BCSIF_STYLE 旗標的 uSplitStyle 具有和參數的 uSplitStyle 成員,然後傳送在 Windows SDK中描述的 BCM_GETSPLITINFO 訊息的結構。

需求

標題: afxwin.h

這個方法會 Windows Vista (含) 以後版本支援。

這個方法的其他需要。 Windows Vista 通用控制項的組建需求說明。

範例

下列程式碼範例會定義變數, m_splitButton,用來以程式設計方式存取分割按鈕控制項。

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

下列程式碼範例會設定分割按鈕的下拉箭號的樣式。 BCSS_ALIGNLEFT 樣式在按鈕的左邊顯示箭號,然後, BCSS_STRETCH 模式會繼續下拉箭號的比例,當您調整按鈕時。

   /* 
    Set the style of the split button drop-down arrow: Display the 
    arrow on the left and retain the arrow's proportions when resizing 
    the control.
    */
    bRC = m_splitButton.SetSplitStyle( BCSS_ALIGNLEFT | BCSS_STRETCH );

請參閱

參考

CButton 類別

階層架構圖表

CButton::GetSplitStyle

CButton::GetSplitInfo

BCM_SETSPLITINFO