Solved

Get C:\ info in the treelistview

Posted on 1998-10-08
6
183 Views
Last Modified: 2013-12-26
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.
0
Comment
Question by:ChristianJ
6 Comments
 
LVL 3

Expert Comment

by:TheAnswerMan
ID: 1487496
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
 

Author Comment

by:ChristianJ
ID: 1487497
Sorry!
It didn't work
Do you have some thing else that might help?
0
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1487498
Take a look at the EnumDesk sample which is located at the Microsoft Owner site. This does what you want.
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 13

Expert Comment

by:Mirkwood
ID: 1487499
Take a look at the EnumDesk sample which is located at the Microsoft Owner site. This does what you want.
0
 

Author Comment

by:ChristianJ
ID: 1487500
it didn't work can I try something else?
0
 
LVL 2

Accepted Solution

by:
JiaH earned 40 total points
ID: 1487501
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

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question