Foxtable(狐表)用户栏目专家坐堂 → [求助]保存目录树名称


  共有1425人关注过本帖树形打印复制链接

主题:[求助]保存目录树名称

帅哥哟,离线,有人找我吗?
有点甜
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2017/12/7 14:55:00 [显示全部帖子]

请举例说明如何用,相连,合成的文本是怎样的?

 

Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1")
For Each nd As WinForm.TreeNode In trv.Nodes
    Dim nr As Row = Tables("表A").addnew
    For Each cnd As WinForm.TreeNode In nd.AllNodes
        If cnd.Nodes.Count = 0 Then
            output.Show(cnd.FullPath)
        End If
    Next
Next


 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2017/12/7 15:52:00 [显示全部帖子]

参考2楼代码。有问题再说。

 

多级节点如何合成显示?请举例说明。


 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2017/12/8 12:18:00 [显示全部帖子]

1、

 

Dim nr As Row = Tables("事件表").current
Dim str As String = ""
For Each nd As WinForm.TreeNode In trv.Nodes
    For Each cnd As WinForm.TreeNode In nd.AllNodes
        If cnd.Nodes.Count = 0 Then
            str &= cnd.FullPath.replace("\", ",") & vbcrlf
        End If
    Next
Next
nr("文本") = str

 

2、

 

Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1")
For i As Integer = 0 To trv.Nodes.count-1
    Dim d1 As Date = trv.nodes(i).text
    Dim idx As Integer = i
    For j As Integer = i+1 To trv.nodes.count-1
        Dim d2 As Date = trv.nodes(j).text
        If d1 > d2 Then
            idx = j
            d1 = d2
        End If
    Next
    Dim node = trv.nodes(idx)
    For j As Integer = i To idx-1
        node.MoveUp
    Next
Next


 回到顶部