All of my TreeView nodes have a unique identifier for Node depth.
I want to set Checked=Truea Node in the TreeView that matches a specific value.
I am currently doing the following:
Dim value As Integer = 57
For Each n As TreeNode In tvForces.Nodes
If n.Value = value Then n.Checked = True
Next
Is there a better way to find the Node that I want to set as Checked=True, rather than scrolling through each node?
I am looking for something like:
Dim value As Integer = 57
n.FindNodesByValue(value)(0).Checked = True
Is there anything similar that I can use?
Curt source
share