Check if a nodes exists in a treeview

G

Giovanni Noppe

Hello,

Do you know a way around to check if a node with a given key exists in a
treeview or not ?
I can't solve this problem and I need it so I can draw or wait to draw a
child node (I may not draw this one if the parent doesn't yet exists).

Thank you in advance,

Gio
 
R

RB Smissaert

Just loop through all the nodes.

Dim nod as Node

For Each nod In MainForm.TreeView1.Nodes
if nod.Key = "key1" Then
Msgbox "found the key"
Exit For
End If
Next

RBS
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top