在一个GroupBox中有多个单选按钮,判断选中的按钮:
foreach (Control ctr in groupBox1.Controls)
{
if(ctr is RadioButton && (ctr as RadioButton).Checked)
{
string value = ctr.Text;
}
}
在一个GroupBox中有多个单选按钮,判断选中的按钮:
foreach (Control ctr in groupBox1.Controls)
{
if(ctr is RadioButton && (ctr as RadioButton).Checked)
{
string value = ctr.Text;
}
}