您的位置:首页 > 编程语言 > C#

C# Controls 添加组件、遍历组件、判断组件名以及为相应组件添加对应函数

2015-06-27 07:07 381 查看
this.groupBox1.Controls.Add(pb1);
this.groupBox1.Controls.Add(pb2);
this.groupBox1.Controls.Add(pb3);
this.groupBox1.Controls.Add(pb4);
this.groupBox1.Controls.Add(pb5);
this.groupBox1.Controls.Add(pb6);
this.groupBox1.Controls.Add(pb7);
this.groupBox1.Controls.Add(pb8);
this.groupBox1.Controls.Add(pb9);
this.groupBox1.Controls.Add(pb10);


 

 

foreach (Control item in this.groupBox1.Controls)
{
if (item is PictureBox)
{
PictureBox pb = item as PictureBox;
pb.Image = null;
}
}


 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息