|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
TreeNode - find the keys of the node.How can I search a treenode, and get the a specific key & value of the
current searched node. Thanks :) On 05/06/2010 13:18, Mr. X. wrote:
> How can I search a treenode, and get the a specific key & value of the Searching Trees is fiddly, because you have to work with their inherent > current searched node. recursiveness. What "key" where you hoping to find? The TreeNode's FullPath property gives you all the parent names as well (actually, the .Text properties, concatenated together): Tree FullPath A A +- B A\B | +- C A\B\C E E| +- D A\B\D If you're holding values against each Node, or each Node is a reference to an object held elsewhere, I would strongly recommend extending the TreeNode class and adding your own properties to your sub-class. Class TreeNoad Inherits TreeNode Public Sub New(byval source as SomeType) m_source = source End Sub Public ReadOnly Property Source() as SomeType Get Return m_source End Get End Property Private m_source as SomeType = Nothing End Class HTH, Phill W. |
|||||||||||||||||||||||