|
-
May 3rd, 2002, 12:40 PM
#1
Thread Starter
Addicted Member
How To Load The Names Of All Files In A Folder In A ListBox?
Catholics Do It With Beads
-
May 3rd, 2002, 12:48 PM
#2
Try this
VB Code:
Private Sub Command1_Click()
Dim LoadFiles As String
List1.Clear
LoadFiles = Dir("c:\program files\qcap\*.*")
Do While LoadFiles > ""
List1.AddItem LoadFiles
LoadFiles = Dir
Loop
End Sub
-
May 3rd, 2002, 12:52 PM
#3
Hyperactive Member
-
May 3rd, 2002, 01:51 PM
#4
Hyperactive Member
What if you didn't want the file names, but just wanted the folder names?
-
May 3rd, 2002, 01:53 PM
#5
A minor amendment to my previous post should do the trick
VB Code:
Private Sub Command1_Click()
List1.Clear
Dim LoadFiles As String
List1.Clear
LoadFiles = Dir("c:\program files\", vbDirectory)
Do While LoadFiles > ""
List1.AddItem LoadFiles
LoadFiles = Dir
Loop
End Sub
-
May 3rd, 2002, 01:54 PM
#6
Hyperactive Member
then use FolderListBox control and check the Path property
-
May 3rd, 2002, 01:54 PM
#7
Hyperactive Member
on second thought it's called the DirListBox control... oops
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
|