CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2001
    Location
    NY, USA
    Posts
    5

    VB6 - Drive, Dir, File ListBox

    I am developing a form for the user Interface and I want to give user an ability to browse file/dir/drive list box to choose the file as an input. I don't know how to synchronise all three controls to work together on the form. I have following three controls on my form.
    1) DriveListBox
    2) DirListBox and
    3) FileListBox
    If I get the code sample from somebody for this, I will really apreciate it.

    Thanks,
    Pshah



  2. #2
    Join Date
    Jun 2001
    Location
    Memphis, TN
    Posts
    146

    Re: VB6 - Drive, Dir, File ListBox

    You could do that with something like this...



    private Sub Dir1_Change()
    File1.Path = Dir1.Path

    End Sub

    private Sub Drive1_Change()
    Dir1.Path = Drive1.Drive

    End Sub




    But have you thought about using the CommonDialog control? All you would have to do is load the control into the project, apply the control to the form and use this code..


    CommonDialog1.ShowOpen
    MyFile = CommonDialog1.Filename






  3. #3
    Join Date
    Aug 2001
    Location
    PA
    Posts
    150

    Re: VB6 - Drive, Dir, File ListBox

    Hi,

    Put the three controls on a form:

    This will help a little in what you are doing

    Private Sub Drive1_Change()
    Dir1.Path = Drive1.Drive
    End Sub

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

    Private Sub File1_Click()

    End Sub

    check it out


    Thanks
    Hisham
    Thank You, Hisham

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

Featured