目录树全选代码
Dim nd,nd1 As WinForm.TreeNode
nd = e.node
If nd.Nodes.Count > 0
For Each nd1 In nd.AllNodes
nd1.Checked = nd.Checked
Next
End If
If e.node.Checked = False
Do While nd.parentnode IsNot Nothing
nd = nd.parentnode
If nd.Nodes.Count > 0
For i As Integer = 0 To nd.Nodes.Count -1
If nd.Nodes(i).Checked = True
Exit Do
End If
If i = nd.Nodes.Count -1
nd.Checked = False
End If
Next
End If
Loop
Else
Do While nd.parentnode IsNot Nothing
nd = nd.parentnode
nd.Checked = True
Loop
End If