62,046
社区成员
发帖
与我相关
我的任务
分享
foreach (Control c in this.Controls)
{
if (c is button)
{
//.....
}else if(c is imagebutton)
{
}else if()........
}
foreach (Control ct in this.form1.Controls)//循环查询表单里面的子控件
{
if (ct.GetType().ToString().Equals("System.Web.UI.WebControls.CheckBox"))//可以变其他类型
{
//.....
}
}