我是这么做的,可还是不行: 在一个对话框中纺织3个radiobox,且第一个选中group,通过classwizard给radiobox赋值变量int m_radio。程序中: switch(m_radio) { case 1: MessageBox("it is one!"); break; case 2: MessageBox("it is two!"); break; case 3: MessageBox("it is three!"); break; default: MessageBox("Please input your selection!"); break; } UpdateData(TRUE);
UpdateData(TRUE);switch(m_radio) { case 0: MessageBox("it is one!"); break; case 1: MessageBox("it is two!"); break; case 2: MessageBox("it is three!"); break; default: MessageBox("Please input your selection!"); break; }
case 0: it is one case 1: it is two case 2: it is three
在一个对话框中纺织3个radiobox,且第一个选中group,通过classwizard给radiobox赋值变量int m_radio。程序中:
switch(m_radio)
{
case 1:
MessageBox("it is one!");
break;
case 2:
MessageBox("it is two!");
break;
case 3:
MessageBox("it is three!");
break;
default:
MessageBox("Please input your selection!");
break;
} UpdateData(TRUE);
但结果当我选中这3个radiobox中的任何一个,弹出的messagebox却不对,不知道上述操作有什么不对的地方?
{
case 0:
MessageBox("it is one!");
break;
case 1:
MessageBox("it is two!");
break;
case 2:
MessageBox("it is three!");
break;
default:
MessageBox("Please input your selection!");
break;
}
case 1: it is two
case 2: it is three