TreeView does not have keys?

  • Thread starter Thread starter Mike G.
  • Start date Start date
M

Mike G.

With the VB6 TreeView, you could identify a node with a key for quick access
to it.

In .NET there is no "keys" property.

Can someone tell me the equivilent of the keys property?

Thanks,

-Mike
 
Never mind, I found out the answer...seems that always happens right after I
post.

The TreeView in .NET has no equivalent "Key" property of that in previous
versions.

Although this Microsoft KB artice shows how to extend the TreeView class to
put in the create a "Key" property.

HOW TO: Create a Key Property for a TreeView Node in Visual Basic .NET
http://support.microsoft.com/default.aspx?scid=KB;EN-US;311318
 
Hello,

This KB article disappoints me. You still have to cycle through every node
to find what node you are looking for. That's what I'm trying to avoid. I
really liked the hashtable like lookup that previous versions of TreeView
provided.

I wonder why Microsoft did not include this in .NET? It seems like a step
backwards for this control.

If anyone has a work-around, please post.

Thanks,

-Mike

Herfried K. Wagner said:
* "Mike G. said:
HOW TO: Create a Key Property for a TreeView Node in Visual Basic .NET
http://support.microsoft.com/default.aspx?scid=KB;EN-US;311318

[Bookmarked]

Thank you!
 
* "Mike G. said:
This KB article disappoints me. You still have to cycle through every node
to find what node you are looking for. That's what I'm trying to avoid. I
really liked the hashtable like lookup that previous versions of TreeView
provided.
ACK.

I wonder why Microsoft did not include this in .NET? It seems like a step
backwards for this control.

In the current March 2004 CTP version of VS 2005, there are still no
keys ;-(.
If anyone has a work-around, please post.

A hashtable :-(.
 
In the current March 2004 CTP version of VS 2005, there are still no
keys ;-(.


A hashtable :-(.

As long as your extending the tree view node, extend the tree view itself
(assuming its not sealed) and add a hashtable. Then every time you add a
node, also add it to the hash table.
 
Back
Top