Simulating a radio button check command
I've开发者_如何学C been trying to change the state of a radio button programatically:
SendMessage(m_hwnd, WM_COMMAND, MAKEWPARAM(IDC_RADIO1, BST_CHECKED), (LPARAM)(hwnd_RADIO1));
Why won't this work?
How about using BM_SETCHECK? http://msdn.microsoft.com/en-us/library/bb775989(VS.85).aspx
Calling CheckRadioButton will select the provided nIDCheckButton
as the active option. It also removes the checkmark from the other radio buttons making up the group.
Alternatively one can use the macro
Button_SetCheck
精彩评论