Ouch - that's interesting, considering the docs say that CollectionBase uses
Equals to implement IList.Contains. I wonder why TreeNodeCollection doesn't
implement IList.Contains the same way.
Thanks for the help!
-Joel
"Mattias Sjögren" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Joel,
>
> >What am I doing wrong?!
>
> Nothing. But it looks like the implementation of
> TreeNodeCollection.Contains() only checks for reference equality, it
> never calls Equals(). I guess you have to maintain a separate list of
> nodes and check that one instead to avoid duplicates.
>
>
>
> Mattias
>
> --
> Mattias Sjögren [MVP] mattias @ mvps.org
> http://www.msjogren.net/dotnet/
> Please reply only to the newsgroup.