共用方式為


CButton::SetDropDownState

設定目前分割按鈕控制項的下拉狀態。

BOOL SetDropDownState(
     BOOL fDropDown
);

參數

參數

描述

[in] fDropDown

設定 BST_DROPDOWNPUSHED 狀態的true ;否則, false。

傳回值

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

備註

分割按鈕控制項 BS_SPLITBUTTONBS_DEFSPLITBUTTON 樣式並包含按鈕和下拉箭號其右邊的。 如需詳細資訊,請參閱 Button Styles。 通常,在中,當使用者按一下下拉箭號時,下拉狀態設定為。 使用這個方法以程式設計方式設定控制項的下拉狀態。 繪製遮蔽的下拉箭號表示這個狀態。

這個方法會將 BCM_SETDROPDOWNSTATE 資訊,在 Windows SDK說明。

需求

標題: 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;

下列程式碼範例會設定分割按鈕控制項的狀態表示下拉式箭號值推入至堆疊。

 /* Set the state of the split button control to indicate that 
    the drop-down arrow is pushed. The arrow is drawn shaded to 
    indicate the state.
    */
    m_splitButton.SetDropDownState( TRUE );

請參閱

參考

CButton 類別

階層架構圖表

BCM_SETDROPDOWNSTATE