foreach (TreeNode node in tv.Nodes) { node.Checked = true; if(node.ChildNodes.Count > 0) checkChildNode(node); } private void checkChildNode(TreeNode node) { foreach (TreeNode chNode in node.ChildNodes) { chNode.Checked = true; if (chNode.ChildNodes.Count > 0) checkChildNode(chNode); } }
For I As Integer = 0 To TreeView1.Nodes.Count TreeView1.Nodes(I).Checked = True Next
foreach (TreeNode node in TreeView1.Nodes) { node.Checked = true; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)