Treeview

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How can I compare 2 treenode elements.

can i do something like this
if a.tag is b.tag then

end if

let me know

thank you.
 
amruta said:
How can I compare 2 treenode elements.

When do you consider two treenode objects to be equal?

If you want to check if two variables reference the same 'TreeNode'
instance, you can use 'If t1 Is t2 Then...'.
 
Herfried,
When do you consider two treenode objects to be equal?

If you want to check if two variables reference the same 'TreeNode'
instance, you can use 'If t1 Is t2 Then...'.
Is this not "Is the same type of object?

Cor
 
Amruta,

Assuming that you set forever the same type of value in a tag than you can
cast it in whatever way.
Assume this
a.Tag = "Amruta"
b.Tag = "Amruta"

Than
a.Tag.ToString = b.Tag.ToString
will go

or if it was an integer value
Cint(a.Tag) etc.

I hope this helps,

Cor
 
If you want to check if two variables reference the same 'TreeNode'
You mean that two variable can reference to the same ojbect which are(is)
not from the same type of object?

:-)

I misreaded it and wrote it even wrong.

:-)

Cor
 
Cor Ligthert said:
You mean that two variable can reference to the same ojbect which are(is)
not from the same type of object?

Well, as you know for sure, object identity implies that there's only a
single object ;-).
 

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

Back
Top