遍历控件,例如遍历一个windows窗体内的控件foreach( Control ctrl in this.Controls )
{
Console.WriteLine ( ctrl.GetType().ToString() + ":\t" + ctrl.Name ); //获得控件类型和名称
}所有窗体控件都继承System.Windows.Forms.Control类,要遍历控件中的控件,可以来个递归循环
{
Console.WriteLine ( ctrl.GetType().ToString() + ":\t" + ctrl.Name ); //获得控件类型和名称
}所有窗体控件都继承System.Windows.Forms.Control类,要遍历控件中的控件,可以来个递归循环
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货