以文本方式查看主题

-  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=102764)

--  作者:苏州老街
--  发布时间:2017/6/25 14:59:00
--  [求助]导出目录树内容
老师,我想把目录树的内容导出到控件表中对号入座

图片点击可在新窗口打开查看此主题相关图片如下:图像 1.png
图片点击可在新窗口打开查看



图片点击可在新窗口打开查看此主题相关图片如下:图像 2.png
图片点击可在新窗口打开查看

--  作者:有点色
--  发布时间:2017/6/25 16:24:00
--  

 循环每一个节点,给表赋值

 

http://www.foxtable.com/webhelp/scr/2302.htm

 


--  作者:苏州老街
--  发布时间:2017/6/25 16:49:00
--  
老师,不会啊
--  作者:有点色
--  发布时间:2017/6/25 17:39:00
--  
Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1")
For Each nd As WinForm.TreeNode In trv.AllNodes
    If nd.Nodes.count = 0 Then
        Dim ndr As DataRow = DataTables("表A").AddNew
        Dim ary() As String = nd.FullPath.Split("\\")
        If ary.length > 0 Then ndr("第一列") = ary(0)
        If ary.length > 1 Then ndr("第二列") = ary(1)
        If ary.length > 2 Then ndr("第三列") = ary(2)
    End If
Next

--  作者:苏州老街
--  发布时间:2017/6/25 22:00:00
--  

老师谢谢了,我想把控件的标题赋值给另外一列。


图片点击可在新窗口打开查看此主题相关图片如下:图像 3.png
图片点击可在新窗口打开查看


--  作者:有点色
--  发布时间:2017/6/26 8:38:00
--  

比如

 

If ary.length > 2 Then ndr("第三列") = ary(2)

 

改成

 

If ary.length > 2 Then

    ndr("第三列") = ary(2).split("|")(0)

    ndr("第四列") = ary(2).split("|")(1)

End If


--  作者:苏州老街
--  发布时间:2017/6/26 10:49:00
--  
老师,下面代码报错


Dim trv As WinForm.TreeView = e.Form.Controls("TreeView3")
For Each nd As WinForm.TreeNode In trv.AllNodes
    If nd.Nodes.count = 0 Then
        Dim ndr As DataRow = DataTables("窗口控件管理").AddNew
        Dim ary() As String = nd.FullPath.Split("\\")
        If ary.length > 0 Then ndr("窗口归类") = ary(0)
        If ary.length > 1 Then ndr("窗口名") = ary(1)
        \'If ary.length > 2 Then ndr("控件名称") = ary(2)
        If ary.length > 2 Then
            ndr("按扭名") = ary(2).split("|")(0)
            ndr("标题") = ary(2).split("|")(1)
        End If
        
        
        
    End If
Next





.NET Framework 版本:2.0.50727.3655
Foxtable 版本:2017.6.12.1
错误所在事件:窗口,授权表,Button8,Click
详细错误信息:
Index was outside the bounds of the array.


--  作者:有点色
--  发布时间:2017/6/26 10:51:00
--  
Dim trv As WinForm.TreeView = e.Form.Controls("TreeView3")
For Each nd As WinForm.TreeNode In trv.AllNodes
    If nd.Nodes.count = 0 Then
        Dim ndr As DataRow = DataTables("窗口控件管理").AddNew
        Dim ary() As String = nd.FullPath.Split("\\")
        If ary.length > 0 Then ndr("窗口归类") = ary(0)
        If ary.length > 1 Then ndr("窗口名") = ary(1)
        \'If ary.length > 2 Then ndr("控件名称") = ary(2)
        If ary.length > 2 Then
            Dim ary2 = ary(2).split("|")
            If ary2.length > 0 Then ndr("按扭名") = ary2(0)
            If ary2.length > 1 Then ndr("标题") = ary2(1)
        End If
    End If
Next

--  作者:苏州老街
--  发布时间:2017/6/26 11:25:00
--  
谢谢老师