ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Extracting Relative Propert of TreeView Node (https://www.excelbanter.com/excel-programming/386498-extracting-relative-propert-treeview-node.html)

ExcelMonkey

Extracting Relative Propert of TreeView Node
 
I know tha the properties of a TreeView node are as seen below:

TreeView1.Add(Relative, Relationship, Key, Text)

How do I extract the Relative Property if I know the Text Property? That is
I know a specific node has a text property of "X". I want to use this to
identify the node and back out the relative property.

Thanks

EM

RB Smissaert

Extracting Relative Propert of TreeView Node
 
The Relative argument only makes sense when adding nodes and if you are
adding nodes then you will know
what the Relative is you are adding to, so I don't quite understand the
question.

Maybe this will get you on the right track.

Sub test()

Dim oNode As Node

For Each oNode In MainForm.TreeView1.Nodes
If oNode.Text = "testing" Then
MsgBox oNode.Previous Is Nothing, , "child node?"
Exit For
End If
Next oNode

End Sub


RBS


"ExcelMonkey" wrote in message
...
I know tha the properties of a TreeView node are as seen below:

TreeView1.Add(Relative, Relationship, Key, Text)

How do I extract the Relative Property if I know the Text Property? That
is
I know a specific node has a text property of "X". I want to use this to
identify the node and back out the relative property.

Thanks

EM




All times are GMT +1. The time now is 08:49 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com