Solved

Get C:\ info in the treelistview

Posted on 1998-10-08
6
179 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
Comment Utility
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
Comment Utility
Sorry!
It didn't work
Do you have some thing else that might help?
0
 
LVL 13

Expert Comment

by:Mirkwood
Comment Utility
Take a look at the EnumDesk sample which is located at the Microsoft Owner site. This does what you want.
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 13

Expert Comment

by:Mirkwood
Comment Utility
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
Comment Utility
it didn't work can I try something else?
0
 
LVL 2

Accepted Solution

by:
JiaH earned 40 total points
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

744 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now