WinForm遍历控件
foreach (Control ctrlSingle in this.Controls)
{
if (ctrlSingle is RadioButton)
{
if (ctrlSingle.Text == strDeviceType)
{
(ctrlSingle as RadioButton).Checked = true;
}
}
}
{
if (ctrlSingle is RadioButton)
{
if (ctrlSingle.Text == strDeviceType)
{
(ctrlSingle as RadioButton).Checked = true;
}
}
}