开发者

Simulating a radio button check command

开发者 https://www.devze.com 2023-01-08 23:25 出处:网络
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));

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

0

精彩评论

暂无评论...
验证码 换一张
取 消