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
Dim bdm,xh,tj As String
Dim cnt,jds As Integer
For Each nd In e.Form.Controls("学员列表树").nodes("全部学员").AllNodes
If nd.Level = 1 And nd.Checked = True
bdm = nd.name
cnt = nd.AllNodes.Count
For Each nd1 In nd.AllNodes
If nd1.Checked = True
xh = xh & "," & nd1.name
jds = jds +1
If jds = cnt
xh = "all"
End If
Else
If xh > ""
xh = xh.Replace("all","")
End If
End If
Next
If xh > ""
xh = xh.Trim(",")
End If
jds = 0
tj = tj & "|" & bdm & "\" & xh
If tj > ""
tj = tj.Trim("|")
End If
End If
Next
Dim jztj As String
If tj > ""
e.Form.Controls("加载条件").text = tj.Replace("|",vbcrlf)
jztj = tj.Replace("|",vbcrlf)
Else
e.Form.Controls("加载条件").text = ""
End If
有点蓝老师:这段代码有没有讲解,看了两个小时,还是看不明白?请老师帮忙注解一下,非常感谢!