Results 1 to 5 of 5

Thread: Dir,list box help

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2001
    Location
    Ca
    Posts
    124

    Cool Dir,list box help

    Can anyone help with this?

    I have a form with a drive box
    i have a directory list box below that
    and a file list box below that

    I want to have the directory list box load the path that i want the user to use.Then i'm looking to have the file list box show the files in the Directory.

    I can e mail the vb files that i've started on.

    Thanks all

    me

  2. #2
    Grate_Dev
    Guest

    Dir,list box help

    Use this code. It might help.

    Private Sub Drive1_Change()
    On Error Resume Next
    Dir1.Path = Drive1.Drive
    End Sub

    Private Sub Dir1_Change()
    On Error Resume Next
    File1.Path = Dir1.Path
    End Sub

    If you wants to filter the display file of File1 control, you can use
    File1.Pattern = "*.asp;*.zip"

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    If you want a specific folder to be defaulted at run time then this should do it.
    VB Code:
    1. Private Sub Form_Load()
    2. Drive1.Drive = "C:"
    3. Dir1.Path = "c:\program files\myfolder"
    4. End Sub
    5.  
    6. Private Sub Drive1_Change()
    7. Dir1.Path = Drive1.Drive
    8. End Sub
    9.  
    10. Private Sub Dir1_Change()
    11. File1.Path = Dir1.Path
    12. End Sub

  4. #4
    Hyperactive Member mvrp350's Avatar
    Join Date
    Feb 2001
    Location
    Best, the Netherlands
    Posts
    322
    Can you please also take a look to this one?
    Error trapping

    Thanx
    Last edited by mvrp350; Dec 12th, 2001 at 08:12 AM.

  5. #5
    Hyperactive Member mvrp350's Avatar
    Join Date
    Feb 2001
    Location
    Best, the Netherlands
    Posts
    322
    sorry guys, just redirected the link in the previous post

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