public static bool AllNodesChecked(TreeNodeCollection nodes)
{
foreach (TreeNode node in nodes)
{
if (!node.Checked)
{
return false;
}
AllNodesChecked(node.Nodes);
}
return true;
}
Test tree
A1(checked) -> B1(unchecked)
A2(checked)
A3(checked)
but it does not return when it clicks node B1.
EDIT: Thanks for helping my tired brain. Recursion should only be undertaken at the beginning of the day after a cold shower.
source
share