public static bool AllNodesChecked(TreeNodeCollection nodes)
{
foreach (TreeNode node in nodes)
{
if (!node.Checked)
{
return false;
}
AllNodesChecked(node.Nodes);
}
return true;
}
Test tree is
A1(checked) -> B1(unchecked)
A2(checked)
A3(checked)
but it isn't returning when it hits node B1.
EDIT: Thank you all for helping my tired brain. Recursion should only be attempted early in the day after a cold shower.