|
-
Sep 24th, 2001, 04:09 AM
#1
Thread Starter
Addicted Member
(Resolved) Problem getting folders and subfolders to appear in treeview....
Hello,
I am trying to create a costom windows explorer with treeview. I can get the drives but I have problems getting all the folders and subfolders. Help please.
vbBoy
Last edited by vbBoy; Sep 26th, 2001 at 11:36 AM.
-
Sep 24th, 2001, 10:50 AM
#2
-
Sep 24th, 2001, 11:10 AM
#3
Need-a-life Member
Something to begin
There's surely a better way, this is too slow:
Code:
Option Explicit
Private Sub Form_Load()
Dirs.Path = "C:\"
TV.Nodes.Add , , "C:\", "C:\"
AllDirs 0
End Sub
Private Sub AllDirs(Indice As Integer)
If Dirs.ListCount Then
If Dirs.List(Indice) = "" Then Exit Sub
TV.Nodes.Add Dirs.Path, tvwChild, Dirs.List(Indice), _
Mid$(Dirs.List(Indice), RInstr(Dirs.List(Indice), "\") + 1)
Dirs.Path = Dirs.List(Indice)
AllDirs 0
Dirs.Path = Left$(Dirs.Path, RInstr(Dirs.Path, "\") - 1)
AllDirs Indice + 1
End If
End Sub
Private Function RInstr(AllString As String, ToFind As String)
Dim i As Integer
For i = Len(AllString) To 1 Step -1
If Mid$(AllString, i, Len(ToFind)) = ToFind Then Exit For
Next i
RInstr = i
End Function
Dirs is a DirListBox and TV is a TreeView. But as I said... it's way too slow
Emiliano F. Martín
If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
Encourage the person who helped you to keep doing it, and give him the points he deserves.
MP3 Organizer: Freeware to logically organize all your MP3s.
-
Sep 24th, 2001, 05:47 PM
#4
Fanatic Member
There is a pretty decent tutorial here on using FSO to populate a Treeview with drives and folders/sub-folders.
http://abstractvb.com/learn.asp?CID=85
Not the fastest way and I'm positive FuzzyBurt will have a comment about using FSO but....
-
Sep 24th, 2001, 06:19 PM
#5
Frenzied Member
Here is a sample I wrote the first week I got my hands on VB4/32 (note the crappy icons) I commented it pretty good because I posted it on a lot of sites back then. I works good but please don't comment on my code it was a long time ago. In fact, I'm amazed I still have it.
It uses the win32 API and not FSO
Greg
Free VB Add-In - The Reference Librarian
Click Here for screen shot and download link.
-
Sep 26th, 2001, 11:35 AM
#6
Thread Starter
Addicted Member
Thanxs Guys
It has helped me a lot.
vbBoy.
-
Sep 28th, 2001, 09:35 AM
#7
PowerPoster
How did you change the title of your post to include (Resolved)
Nice idea
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|