Herfried,
[color=blue]
>
> 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...'.
>[/color]
Is this not "Is the same type of object?
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
"amruta" <amruta@discuss ions.microsoft. com> schreef in bericht
news:2E731EA1-C209-40C7-B6CC-68C363B50CC2@mi crosoft.com...[color=blue]
> 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.
>
>[/color]
"Cor Ligthert [MVP]" <notmyfirstname @planet.nl> schrieb:[color=blue][color=green]
>> 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...'.
>>[/color]
> Is this not "Is the same type of object?[/color]
No.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
>>> If you want to check if two variables reference the same 'TreeNode'[color=blue][color=green][color=darkred]
>>> instance, you can use 'If t1 Is t2 Then...'.
>>>[/color]
>> Is this not "Is the same type of object?[/color]
>
> No.
>[/color]
You mean that two variable can reference to the same ojbect which are(is)
not from the same type of object?
"Cor Ligthert [MVP]" <notmyfirstname @planet.nl> schrieb:[color=blue][color=green][color=darkred]
>>>> 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?[/color]
>>
>> No.
>>[/color]
> You mean that two variable can reference to the same ojbect which are(is)
> not from the same type of object?[/color]
Well, as you know for sure, object identity implies that there's only a
single object ;-).
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Comment