case IDC_RADIO:
{
char sz[256]="选中了单选框Radio";
static int i=0;
i++;
// 是否选中单选按钮
UINT bChecked = ::IsDlgButtonChecked(hDlg, IDC_RADIO);
//选中并且是第i次单击时 (i=1,3,5,7...)
if(BST_CHECKED==bChecked&&(i%2==1))
{
/*::CheckDlgButton(hDlg, IDC_RADIO, BST_CHECKED);*/
//::CheckDlgButton(hDlg, IDC_RADIO, BST_UNCHECKED);在上面的静态文本控件输出
::SetWindowText(::GetDlgItem(hDlg, IDC_STATIC1), sz);
}
else
{
// 设置本控件为未选中状态
::CheckDlgButton(hDlg, IDC_RADIO, BST_UNCHECKED);
::SetWindowText(::GetDlgItem(hDlg, IDC_STATIC1), "");
}
// 是否选中单选按钮
//BOOL bChecked = ::IsDlgButtonChecked(hDlg, IDC_RADIO);
//// 设置上面的button有效状态
//::EnableWindow(::GetDlgItem(hDlg, IDOK), bChecked);
//// 设置本控件状态
//::CheckDlgButton(hDlg, IDC_RADIO, !bChecked);
}
break;