Foxtable(狐表)用户栏目专家坐堂 → 树加载和对话框中显示加载的不对啊?请大师指导


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

主题:树加载和对话框中显示加载的不对啊?请大师指导

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


加好友 发短信
等级:管理员 帖子:47511 积分:251479 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2015/6/12 9:22:00 [显示全部帖子]

基本逻辑问题,选了父子并不需要同时选。

 

Afterchecknode的事件代码改为:

 

Dim trv As WinForm.TreeView = e.sender
If e.node.ParentNode IsNot Nothing Then
    e.node.ParentNode.Checked = False
End If
For Each nd As WinForm.TreeNode In e.node.Nodes
    nd.Checked = False
Next
Dim s As String
For Each nd As WinForm.TreeNode In trv.Nodes(0).Nodes
    Dim v As String = ""
    If nd.Checked Then
        v = nd.Text & "/all"
    Else
        For Each cd As WinForm.TreeNode In nd.Nodes
            If cd.Checked Then
                If v = "" Then
                    v = v & nd.Text & "/"
                End If
                v = v & cd.Text & ","
            End If
        Next
    End If
    If v > "" Then
        If s > "" Then
            s = s & vbcrlf
        End If
        s = s & v.Trim(",")
    End If
Next
MessageBox.show(s)

[此贴子已经被作者于2015/6/12 9:24:31编辑过]

 回到顶部