通过控件名称 获取控件

来源:互联网 发布:thewolf软件平台 编辑:程序博客网 时间:2024/04/25 21:22

//通过控件名称 获取控件
        private Control GetControl(string name)
        {
            foreach (Control c in this.Controls)
            {
                if (c.Name == name)
                {
                    return c;
                }
            }
            return null;
        }  

原创粉丝点击