PDA

Click to See Complete Forum and Search --> : List all files in given directory


QWERTY
Nov 19th, 1999, 12:50 PM
I think that topic explains everything.
Thanks in advance

------------------
Visual Basic Programmer (at least I want to be one)
------------------
PolComSoft
You will hear a lot about it.

DiGiTaIErRoR
Nov 19th, 1999, 03:59 PM
just use a file box make the extension = *.* or if you want commondialog do the same....
hopes this helps

------------------
DiGiTaIErRoR

razzaj
Nov 19th, 1999, 04:54 PM
u must add a dir list and a file list
type in form code :

Private Sub Dir1_Change()
File1.Path = Dir1
End Sub

or if u want :
u can add to the form in addition for the
controls i told u about a text box and write this code:

Private Sub Dir1_Change()
Text1 = Dir1
File1.Path = Dir1
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
On Error GoTo xerror
File1.Path = Text1

GoTo noxerror
xerror:
MsgBox "Invalid Path", vbOKOnly, "error"
noxerror:

End If

End Sub


this should work ... if u need any other help just message me :))

- regards -
- razzaj -

Aaron Young
Nov 20th, 1999, 11:06 AM
Alternatively you can use the Dir Function, eg.

Private Sub Command1_Click()
Dim sDir As String
sDir = Dir("C:\Files\*")
While Len(sDir)
List1.AddItem sDir
sDir = Dir
Wend
End Sub



------------------
Aaron Young
Analyst Programmer
aarony@redwingsoftware.com
adyoung@win.bright.net