惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

H
Help Net Security
博客园 - Franky
GbyAI
GbyAI
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
爱范儿
爱范儿
IT之家
IT之家
酷 壳 – CoolShell
酷 壳 – CoolShell
aimingoo的专栏
aimingoo的专栏
博客园_首页
MongoDB | Blog
MongoDB | Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Recent Announcements
Recent Announcements
Scott Helme
Scott Helme
有赞技术团队
有赞技术团队
M
MIT News - Artificial intelligence
C
CERT Recently Published Vulnerability Notes
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Jina AI
Jina AI
F
Fortinet All Blogs
N
Netflix TechBlog - Medium
L
LangChain Blog
L
LINUX DO - 最新话题
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
H
Hacker News: Front Page
MyScale Blog
MyScale Blog
P
Palo Alto Networks Blog
G
Google Developers Blog
Google DeepMind News
Google DeepMind News
AI
AI
T
Troy Hunt's Blog
Microsoft Azure Blog
Microsoft Azure Blog
阮一峰的网络日志
阮一峰的网络日志
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Vercel News
Vercel News
Microsoft Security Blog
Microsoft Security Blog
罗磊的独立博客
S
Secure Thoughts
大猫的无限游戏
大猫的无限游戏
博客园 - 叶小钗
人人都是产品经理
人人都是产品经理
Blog — PlanetScale
Blog — PlanetScale
博客园 - 司徒正美
Apple Machine Learning Research
Apple Machine Learning Research
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 三生石上(FineUI控件)
S
Security @ Cisco Blogs
Cloudbric
Cloudbric
E
Exploit-DB.com RSS Feed
Attack and Defense Labs
Attack and Defense Labs

博客园 - 禹过天晴

TextControl技术互助 博文阅读密码验证 - 博客园 (转)不通过web.config在运行时注册httpmodules (学)如何在Oracle中一次执行多条sql语句 (学)条件性唯一性索引的建议 阿里云服务器IIS启用HTTPS协议(转) (原)用WebBrowser浏览Office Web Apps Server,除去“下载”按钮 博文阅读密码验证 - 博客园 如何让Oracle表及字段显示为区分大小写(转) (转)SQL Server 列转行 博文阅读密码验证 - 博客园 (转)基于SQL的EAN13、ENA8条形码校验位生成 博文阅读密码验证 - 博客园 (原)将Oracle迁移到SQLServer (转)Sql Server 快速查看表结构(表描述及字段说明) 博文阅读密码验证 - 博客园 (转)SQL查询案例:多行转换为一行 (转)找回vss超级管理员密码 (转)SqlServer里DateTime转字符串
(学)递归查找窗体中全部控件
禹过天晴 · 2018-01-17 · via 博客园 - 禹过天晴
/// <summary>
        /// 通过递归将控件及子级控件信息列为树形
        /// </summary>
        /// <param name="pControl"></param>
        /// <param name="pControlName"></param>
        public void BuildControlTree(dynamic pControl, string pControlName = null)
        {
            try
            {
                string strConName = "";
                if (pControl.Name == "" && pControl.Text == "") return;
                //if (PCon is DevExpress.XtraEditors.SplitGroupPanel)
                //    strConName = PID + PCon.Text;
                //else
                //    strConName = PCon.Name == "" ? PCon.Text : PCon.Name;
                strConName = (pControlName == null ? "" : pControlName + "-") + (pControl.Name == "" ? pControl.Text : pControl.Name);
                DataRow dr = dsControlTree.DT_ControlTree.NewRow();
                dr["ID"] = strConName;
                dr["ParentID"] = pControlName;
                dr["ControlName"] = strConName;
                dr["ControlType"] = pControl.GetType().Name;
                dsControlTree.DT_ControlTree.Rows.Add(dr);
                //DicCon.Add(strConName, PCon);
                //插入其子控件
                if (pControl is GridControl)
                {
                    //循环其gridview
                    foreach (GridView gv in pControl.Views)
                    {
                        BuildControlTree(gv, strConName);
                    }
                }
                else if (pControl is GridView)
                {
                    //循环其gridcolumn
                    foreach (GridColumn gdc in pControl.Columns)
                    {
                        BuildControlTree(gdc, strConName);
                    }
                }
                else if (pControl is LayoutControl)
                {
                    return;
                }
                else if (pControl is TreeList)
                {
                    //循环其TreeListColumn
                    foreach (TreeListColumn tlc in pControl.Columns)
                    {
                        BuildControlTree(tlc, strConName);
                    }
                }
                else
                {
                    if (pControl is Control && pControl.Controls.Count > 0)
                    {
                        foreach (Control CCom in pControl.Controls)
                        {
                            BuildControlTree(CCom, strConName);
                        }
                    }
                }
            }
            catch
            { }
        }