WinForm遍历控件

foreach (Control ctrlSingle in this.Controls)
{
    if (ctrlSingle is RadioButton)
    {
        if (ctrlSingle.Text == strDeviceType)
        {
            (ctrlSingle as RadioButton).Checked = true;
        }
    }
}
posted on 2008-12-01 16:14  一路前行  阅读(463)  评论(0编辑  收藏  举报