我拖了很多个checkbox 在窗体,用什么方法遍历这些控件?谢谢。
------解决方案--------------------
- C# code
foreach(Control ctl in this.Controls) { CheckBox ck = ctl as CheckBox; if (ck != null) ck.Checked = true; }
------解决方案--------------------
foreach(Control ctl in this.Controls) { CheckBox ck = ctl as CheckBox; if (ck != null) ck.Checked = true; }
------解决方案--------------------