积极答复者
radio 控件取值的一个问题

问题
答案
-
您的一个组内的Radio控件应该关联一个int类型的变量,比如m_nValue; 需要的时候可以调用下面的代码 UpdateData(TRUE); CString str; str.Format(_T("%d"), m_nValue); AfxMessageBox(str);
Visual C++ enthusiast, like network programming and driver development. At present is being engaged in the WinCE/Windows Mobile platform embedded development.- 已标记为答案 Honny_yeyh 2011年2月23日 7:46
全部回复
-
CString sql;
for (int i=IDC_RADIO1;i<IDC_Shh+1;i++)
{
CButton *pBTN=static_cast<CButton*>(GetDlgItem(i));
if(pBTN!=NULL)
{
if(pBTN->GetCheck()==BST_CHECKED)
{
CString UUtext;
pBTN->GetWindowText(UUtext);
MessageBox(UUtext);
switch (UUtext)
{
case GBANDPRICE:
sql = yyy1;
break;
case CMC:
sql = hhh2;
break;
case CTL:
sql = hhh3;
break;
Default:
sql = hhh1;
break;
} -
您的一个组内的Radio控件应该关联一个int类型的变量,比如m_nValue; 需要的时候可以调用下面的代码 UpdateData(TRUE); CString str; str.Format(_T("%d"), m_nValue); AfxMessageBox(str);
Visual C++ enthusiast, like network programming and driver development. At present is being engaged in the WinCE/Windows Mobile platform embedded development.- 已标记为答案 Honny_yeyh 2011年2月23日 7:46