Примерно так:
Private Sub SetMyChildren(ByVal parentNode As TreeNode, ByVal isChecked As Boolean, ByVal isSelected As Boolean)
parentNode.Checked = isChecked
parentNode.Selected = isSelected
For Each child As TreeNode In parentNode.ChildNodes
SetMyChildren(child, isChecked, isSelected)
Next
End Sub
'f.e. set all nodes from complete TreeView to checked and selected:
For Each node As TreeNode In TreeView1.Nodes
SetMyChildren(node, True, True)
Next