- Notifications
You must be signed in to change notification settings - Fork 961
/
Copy pathcbutton-class_5.cpp
20 lines (17 loc) · 671 Bytes
/
cbutton-class_5.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
CButton myRadioButton;
// Create a radio button.
myRadioButton.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 = myRadioButton.GetButtonStyle();
if (uStyle == BS_PUSHBUTTON)
uStyle = BS_DEFPUSHBUTTON;
elseif (uStyle == BS_RADIOBUTTON)
uStyle = BS_AUTORADIOBUTTON;
elseif (uStyle == BS_CHECKBOX)
uStyle = BS_AUTOCHECKBOX;
elseif (uStyle == BS_3STATE)
uStyle = BS_AUTO3STATE;
// Change the button style to the one wanted.
myRadioButton.SetButtonStyle(uStyle);