Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

CButton::SetDropDownState

Sets the drop-down state of the current split button control.

BOOL SetDropDownState(
     BOOL fDropDown
);

Parameter

Description

[in] fDropDown

true to set BST_DROPDOWNPUSHED state; otherwise, false.

true if this method is successful; otherwise, false.

A split button control has a style of BS_SPLITBUTTON or BS_DEFSPLITBUTTON and consists of a button and a drop-down arrow to its right. For more information, see Button Styles. Usually, the drop-down state is set when the user clicks the drop-down arrow. Use this method to programmatically set the drop-down state of the control. The drop-down arrow is drawn shaded to indicate the state.

This method sends the BCM_SETDROPDOWNSTATE message, which is described in the Windows SDK.

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.

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 sets the state of the split button control to indicate that the drop-down arrow is pushed.

	/* 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 );
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.