110,535
社区成员
发帖
与我相关
我的任务
分享
string str =string.Empty;
foreach (Control c in tabPage2.Controls)
{
if (c is RadioButton)
{
RadioButton rbtn = c as RadioButton;
if (rbtn!=null&&rbtn.Checked)
{
str += rbtn.Text +",";
break;
}
}
}
MessageBox.Show(str.TrimEnd(','));
Control.ControlCollection cc = this.Controls.Find("groupBox1", true)[0].Controls;
string str =string.Empty;
foreach (Control c in cc)
{
if (c is RadioButton)
{
RadioButton rbtn = (RadioButton)c;
if (rbtn.Checked)
{
str = rbtn.Text;
break;
}
}
}
MessageBox.Show(str);