FullPath Property Example

This example adds several Node objects to a TreeView control and displays the fully qualified path of each when selected. To try the example, place a TreeView control on a form and paste the code into the form's Declarations section. Run the example, then select a node and click the form to display the Node object's full path.

Private Sub Form_Load()
   Dim nodX As Node
   Set nodX = TreeView1.Nodes.Add(,,,"Root")
   Set nodX = TreeView1.Nodes.Add(1,tvwChild,,"Dir1")
   Set nodX = TreeView1.Nodes.Add(2,tvwChild,,"Dir2")
   Set nodX = TreeView1.Nodes.Add(3,tvwChild,,"Dir3")
   Set nodX = TreeView1.Nodes.Add(4,tvwChild,,"Dir4")
   nodX.EnsureVisible   ' Show all nodes.
   TreeView1.Style = tvwTreelinesText ' Style 4.
End Sub

Private Sub TreeView1_NodeClick(ByVal Node As Node)
   MsgBox Node.FullPath
End Sub