|
-
Sep 29th, 2000, 03:22 PM
#1
Thread Starter
Addicted Member
How do you store the contents of a folder in a list box?
I.E.>If I wanted to store all files located in the My Documnets folder in a list box.
212 will lead you to the truth
-
Sep 29th, 2000, 04:10 PM
#2
Frenzied Member
Just use a FileListBox, the one next to the yellow DirListBox
Code:
File1.Path = "c:\My Documents"
'This will show all files in C:\My Documents!
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
-
Sep 29th, 2000, 04:37 PM
#3
Hyperactive Member
I am doing this off the top of my head but this should work. What Jop gave you was for a file box but if you want it in a list box what you do is this.
Add 1 file box make visible false and add 1 listbox.
Code:
Option Explicit
Private Sub Form_Load()
Dim a As Integer
File1.Path = "c:\My Documents"
Do Until File1.ListIndex + 1 = File1.ListCount
File1.ListIndex = a
List1.AddItem File1.FileName, a
a = a + 1
Loop
End Sub
That works I went and I tested it. If you only want to add certain files like only Mp3's or something make the file box only show mp3s then the list box will only add mp3s.
Hope this helps!!
[Edited by PITBULLCJR on 09-29-2000 at 06:05 PM]
-
Oct 2nd, 2000, 09:54 AM
#4
Thread Starter
Addicted Member
212 will lead you to the truth
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
|