Private Sub CheckTreeNode(ByVal Node As TreeNode)
For Each tvNode As TreeNode In Node.Nodes
tvNode.Checked = False
CheckTreeNode(tvNode)
Next
End Sub
Private Sub tvStep_Check(ByVal sender As Object, ByVal e As Microsoft.Web.UI.WebControls.TreeViewClickEventArgs) Handles tvStep.Check
Dim oNode As TreeNode = Me.tvStep.GetNodeFromIndex(e.Node)
If oNode.Checked Then
If (Not oNode.Parent Is Nothing) And (Not oNode.Parent.GetType Is GetType(TreeView)) Then
oNode.Parent.Checked = True
End If
CheckTreeNode(oNode)
End If
End Sub
最重要的是递归的思想(WEB)