CreateWindowEx(0, L"BUTTON", L"1", WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON|WS_GROUP, 50, 260, 200, 20, hWnd, (HMENU)1007, hInst, NULL);
CreateWindowEx(0, L"BUTTON", L"2", WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON, 50, 290, 200, 20, hWnd, (HMENU)1008, hInst, NULL);
CreateWindowEx(0, L"BUTTON", L"3", WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON|WS_GROUP, 50, 320, 200, 20, hWnd, (HMENU)1009, hInst, NULL);
CreateWindowEx(0, L"BUTTON", L"4", WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON, 50, 350, 200, 20, hWnd, (HMENU)1010, hInst, NULL);
关于单选按钮的分组
要在创建分组的第一个按钮是添加WS_GROUP.然后后续添加,直到碰到下一个WS_GROUP之前
添加的单选按钮为一组.
CreateWindowEx(0, L"BUTTON", L"2", WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON, 50, 290, 200, 20, hWnd, (HMENU)1008, hInst, NULL);
CreateWindowEx(0, L"BUTTON", L"3", WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON|WS_GROUP, 50, 320, 200, 20, hWnd, (HMENU)1009, hInst, NULL);
CreateWindowEx(0, L"BUTTON", L"4", WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON, 50, 350, 200, 20, hWnd, (HMENU)1010, hInst, NULL);
关于单选按钮的分组
要在创建分组的第一个按钮是添加WS_GROUP.然后后续添加,直到碰到下一个WS_GROUP之前
添加的单选按钮为一组.