以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助]遍历控件生成目录树的问题  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=85400)

--  作者:hzcaqjf
--  发布时间:2016/5/25 9:20:00
--  [求助]遍历控件生成目录树的问题
原代码生成的目录树有五级节点,如何不增加splitcontainer节点,使目录树中只有四级节点?
如下所示:

  -全部按钮
    -page
        -groupbox
           -button
 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:管理项目1(1).foxdb


--  作者:大红袍
--  发布时间:2016/5/25 9:24:00
--  
Dim node As WinForm.TreeNode = Args(0)
Dim ctl = Args(1)
For Each c As object In ctl.Children
    If Typeof c Is WinForm.SplitContainer Then
        If c.panel1.Children.Count > 0 Then Functions.Execute("AddChild",node,c.panel1)
        If c.panel2.Children.Count > 0 Then Functions.Execute("AddChild",node,c.panel2)
    Else
        Dim n  = node.Nodes.Add(c.Name)
        If Typeof c Is WinForm.Panel OrElse Typeof c Is WinForm.GroupBox Then
            If c.Children.Count > 0 Then Functions.Execute("AddChild",n,c)
        End If
    End If
Next

--  作者:hzcaqjf
--  发布时间:2016/5/25 10:10:00
--  
问题已解决,谢谢大红袍老师.