111,129
社区成员
发帖
与我相关
我的任务
分享 this.Controls.OfType<TextBox>() //oftype 意思是只返回这个类型的对象,我这里为只返回textbox
.Aggregate((t1,t2)=>{
//t1就是当前这个,t2就是下一个,当然这个方法下面你的把t2返回一下,作为迭代的种子
return t2;
})
var ctrls = this.panel.Controls.OfType<PictureBox>();
for (int i = 1; i <= 80; i++)
{
((CheckBox)this.Controls.Find("checkBox" + i, true)[0]).Checked = false;
}