TreeView Help Needed

oceanic99
03-14-2003, 04:26 PM
I'm creating an Explorer style interface for an application. I have a form with a TreeView control and a ListView control. I need a little help getting started with the TreeView control and have not found any good examples. My question is fairly simple, I'm just unfortunately not very familiar with this particular control. I do not want to display the directories for all drives, only for a specific folder.


Here is my question:

If I wanted to have the root node be "C:\My Documents" how would I add that to the TreeView control? I do not want to display any other directories in my TreeView control.

Here is what I have tried:

Dim rootFolder As Folder
Dim fso As New Scripting.FileSystemObject

rootFolder = fso.GetFolder("C:\My Documents")

tvMyTreeView.Nodes.Add , , rootFolder, rootFolder.Name

Any help would be greatly appreciated. Currently nothing displays in the TreeView control when I run the application.

italkid
03-14-2003, 07:05 PM
Don't know much about the treeview stuff but this is an treeview based folderbrowser example i found on PSC.

Hope you can use this somehow.

italkid.

OnErr0r
03-15-2003, 11:04 AM
I'm creating an Explorer style interface for an application. I have a form with a TreeView control and a ListView control. I need a little help getting started with the TreeView control and have not found any good examples. My question is fairly simple, I'm just unfortunately not very familiar with this particular control. I do not want to display the directories for all drives, only for a specific folder.


Here is my question:

If I wanted to have the root node be "C:\My Documents" how would I add that to the TreeView control? I do not want to display any other directories in my TreeView control.

Here is what I have tried:

Dim rootFolder As Folder
Dim fso As New Scripting.FileSystemObject

rootFolder = fso.GetFolder("C:\My Documents")

tvMyTreeView.Nodes.Add , , rootFolder, rootFolder.Name

Any help would be greatly appreciated. Currently nothing displays in the TreeView control when I run the application.

Here is an example of enumerating drives and directories I wrote a while back for vbaccelerator.

OnErr0r
03-15-2003, 11:05 AM
hmmm... attachment didn't come through...

oceanic99
03-17-2003, 09:28 AM
Thanks so much for the examples. I'm sure I'll be able to make good use of them.

Best Regards,

Oceanic99

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum