Results 1 to 4 of 4

Thread: List all files in given directory

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Oct 1999
    Location
    MA, USA
    Posts
    523

    Post

    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.


  2. #2
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111

    Post

    just use a file box make the extension = *.* or if you want commondialog do the same....
    hopes this helps

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

  3. #3
    Hyperactive Member razzaj's Avatar
    Join Date
    Oct 1999
    Location
    jounieh
    Posts
    261

    Post

    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 -

  4. #4
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177

    Post

    Alternatively you can use the Dir Function, eg.
    Code:
    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
    [email protected]
    [email protected]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width