C#中基础知识积累

时间:2014-11-24 13:13:19   收藏:0   阅读:193

C#中,获取容器中所有控件

foreach (Control contr in this.palchangepassword.Controls)
            {
                contr.Visible = true;
            }

C#中,获取容器中某种控件

 foreach (Control con in this.Controls)
           {
               if (con.GetType() == typeof(Label))
               {
                   con.Visible = false;
               }
           }

评论(0)
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!