CButton::GetButtonStyle

UINT GetButtonStyle( ) const;

Return Value

Returns the button styles for this CButton object.

Remarks

This function returns only the BS_ style values, not any of the other window styles.

Example

CButton myButton;

// Create an auto 3-state button.
myButton.Create(_T("My button"), WS_CHILD|WS_VISIBLE|BS_RADIOBUTTON, 
   CRect(10,10,100,30), pParentWnd, 1);

// Change the button style to use one of the "auto" styles, for
// push button change to def push button.
UINT uStyle = myButton.GetButtonStyle();
if (uStyle & BS_PUSHBUTTON)
   uStyle = (uStyle & ~BS_PUSHBUTTON) | BS_DEFPUSHBUTTON;
else if (uStyle & BS_RADIOBUTTON)
   uStyle = (uStyle & ~BS_RADIOBUTTON) | BS_AUTORADIOBUTTON;
else if (uStyle & BS_CHECKBOX)
   uStyle = (uStyle & ~BS_CHECKBOX) | BS_AUTOCHECKBOX;
else if (uStyle & BS_3STATE)
   uStyle = (uStyle & ~BS_3STATE) | BS_AUTO3STATE;

// Change the button style to the one wanted.
myButton.SetButtonStyle( uStyle );

CButton OverviewClass MembersHierarchy Chart

See Also   CButton::SetButtonStyle, ::GetWindowLong