|
-
Jan 12th, 2000, 09:35 PM
#1
Thread Starter
Lively Member
how do you get your program to get a list of files with a certain extension that are located in the same directory as your app into a listbox?
-
Jan 12th, 2000, 09:59 PM
#2
Frenzied Member
use a filelistbox
and ...
File1.Pattern = "*.exe" ' or whatever
File1.Path = App.Path
File1.Refresh
-
Jan 12th, 2000, 10:06 PM
#3
You can use the FileListBox. Just set the pattern property to whatever files you want to show.
If you want to use an ordinary ListBox you can use code simular to this:
Private Sub FillListBox(sPath$, sPattern$, lstBox As ListBox)
Dim sFile$
sPath = spath & IIf(Right$(sPath, 1)<>"\", "\", "")
sFile = Dir(sPath & sPattern)
Do While Len(sFile) > 0
lstBox.AddItem sFile
sFile = Dir
Loop
End Sub
You call the sub above in the following manner:
FillListBox "C:\", "*.exe", List1
This will fill a listbox named List1 whit all files in the C:\ directory that has the .Exe extension.
Good luck!
------------------
Joacim Andersson
[email protected]
[email protected]
www.YellowBlazer.com
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
|