Jeff,
Yes, instead of searching all the tab pages at the same time, why not
set the Tag property of the TreeViewNode to the tab page itself when it is
created. Then, when you check the leaf, if the Tag property has the
reference, just set the focus to that, otherwise, if it doesn't, create and
add the tab page and set the Tag property. This way, you don't have to
search the tab page list every time.

Signature
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com
> .NET 2.0
>
[quoted text clipped - 27 lines]
>
> any suggetions?
Jeff - 14 Oct 2007 17:32 GMT
thanks, but when I have a reference to the tabpage in the treeviewitem's tag
property. How do I give this tabpage focus? All I got is the reference to
the tabpage, and I AFAIK I cannot use that value on tabcontrol.selectedindex
?
any suggestions?
Jeff
Nicholas Paldino [.NET/C# MVP] - 15 Oct 2007 00:03 GMT
Jeff,
You don't have to store the tab page. You can store the index of the
tab page in the Tag property (if it is null, then you know there is no tab
page) and then set the selected index to that.

Signature
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com
> thanks, but when I have a reference to the tabpage in the treeviewitem's
> tag property. How do I give this tabpage focus? All I got is the reference
[quoted text clipped - 4 lines]
>
> Jeff