Get C:\ info in the treelistview

I followed AllanC_Jr's advice to run a "VB Application Wizard" and choose Explorer Style and it worked. Now I want to know what to write so the information on the harddrive appear in the "TreelistView" Then I want to link the "treelistView" with the "ListView" what are the codes?

Description: I want to be able to doubleclick on the driver C: in the "Treelistview" (the directories appears), when I doubleclick on one directory the contents appears in the "ListView"

If you can solve this for my, please do. It will mean a lot to me.
ChristianJAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
JiaHConnect With a Mentor Commented:
How about this one:
Keep the Node.FullPath to a variable in the TreeView's NodeClick event, in the TreeView's DblClick event, use this variable  and the Dir to get all the contents under the directory , then what you need is add them to the listview.

Good luck!
0
 
TheAnswerManCommented:
Private Sub Tree_Click()
   call fsb_GetTree(Tree.SelectedItem)
End Sub

Private Sub fsb_GetTree(as_Path As String)
Dim ls_DirName As String
On Error Resume Next
ListView1.Arrange = lvwAutoLeft
ls_DirName = Dir(as_Path, vbDirectory)
Do While ls_DirName <> ""
   If ls_DirName <> "." And ls_DirName <> ".." Then
      If (GetAttr(as_Path & ls_DirName) And vbDirectory) = vbDirectory Then
         ListView1.ListItems.Add Text:=ls_DirName
      End If
   End If
   ls_DirName = Dir
Loop

End Sub
0
 
ChristianJAuthor Commented:
Sorry!
It didn't work
Do you have some thing else that might help?
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
MirkwoodCommented:
Take a look at the EnumDesk sample which is located at the Microsoft Owner site. This does what you want.
0
 
MirkwoodCommented:
Take a look at the EnumDesk sample which is located at the Microsoft Owner site. This does what you want.
0
 
ChristianJAuthor Commented:
it didn't work can I try something else?
0
All Courses

From novice to tech pro — start learning today.