CButton::SetDropDownState

设置当前拆分按钮控件的下拉式状态。

BOOL SetDropDownState(
     BOOL fDropDown
);

参数

Parameter

说明

[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 Class

层次结构图

BCM_SETDROPDOWNSTATE