You need to loop through all nodes and their child nodes.
private void CheckChildren(TreeNode node)
{
foreach (TreeNode n in node.Nodes) {
n.Checked = node.Checked;
CheckChildren(n);
}
}
Passing root node to this function will mark all the nodes as checked/unchecked. You can code it as per your need.