日期:2014-05-20  浏览次数:20708 次

C# winform checkbox 的遍历
我拖了很多个checkbox 在窗体,用什么方法遍历这些控件?谢谢。

------解决方案--------------------
C# code

            foreach(Control ctl in this.Controls)
            {
                CheckBox ck = ctl as CheckBox;
                if (ck != null)
                    ck.Checked = true;
            }

------解决方案--------------------
探讨
C# code

foreach(Control ctl in this.Controls)
{
CheckBox ck = ctl as CheckBox;
if (ck != null)
ck.Checked = true;
……