VS C# Winform treeview: I'm a beginner and appreciate the help.
I want to uncheck boxes of previous selected node. The application only allows the user to select a node with children. They can then check child nodes. If they then select another parent node the previous check boxes need to be cleared.
Parent1 has child nodes A, B, & C Parent2 has child nodes X, Y, & Z If Parent 1 is selected and A, B, & C are checked and the user then selects Parent2, the checkboxes of A, B, & C of Parent 1 need to be cleared.
I've tried catching the SelectedNode in the beforeSelect event with TreeNode tnBeforeSelect = tvFileMan.SelectedNode; but when I try to use it in the after select event it doesn't exist in that context. I have a global variables class but could not figure out how to add a treenode variable. I thought I could then uncheck in the afterCheck event with something like.
foreach (TreeNode tn in tnBeforeSelect)
{
tnBeforeSelect.Nodes.Checked = false;
}
foreach
loop? – Alex Jolig