tonelm54
asked on
VB.net TreeView find node
Im playing with the treeview control, but cant find if a particular path exists,
What Im trying to do is test if a particular path exists from root and return yes or no.
To try and test my idea, ive written the code below which should give the msgbox "Found path!"
Any ideas?
What Im trying to do is test if a particular path exists from root and return yes or no.
To try and test my idea, ive written the code below which should give the msgbox "Found path!"
Any ideas?
TreeView1.Nodes.Add("Nodes_1").Nodes.Add("Nodes_1.1").Nodes.Add("Nodes_1.1.1")
If TreeView1.Nodes.Find("Nodes_1\Nodes1.1\Nodes_1.1.2", False) Is Nothing Then
MsgBox("Not Found!")
Else
MsgBox("Found path!")
End If
ASKER
lol, Hi I opened a new question to go along another idea path.
When I try and run your code I get:-
'ChildNodes' is not a member of 'System.Windows.Forms.Tree Node'.
When I try and run your code I get:-
'ChildNodes' is not a member of 'System.Windows.Forms.Tree
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
@jpaulino,
Yes! I've just noticed that and was about to upload a snippet for WinForms. Points for you then! :)
Yes! I've just noticed that and was about to upload a snippet for WinForms. Points for you then! :)
ASKER
Kool, that works!
Thank you
Thank you
Look, this works for me, have a look:
Open in new window