Results 1 to 2 of 2

Thread: Selecting a Folder with Common Dialog?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Posts
    316

    Red face

    I am wanting a user to select the default path for projects when going to open a common dialog to browse for them.

    So in an options menu I wrote the following code:

    Code:
    Private Sub cmdBrowse_Click()
    
    On Error GoTo DialogError
        
        With CommonDialog1
        
            .CancelError = True
            .InitDir = "C:\Temp\"
            .DialogTitle = "Select the Initial Directory"
            .ShowOpen
            
        End With
        
    DialogError:
        
    End Sub
    But, I still have to select a particular file in order to get back to the options screen. How can I just browse into the folder that I want and then select open and have that folder value be returned to Text1.txt

    Thanks for the help.
    Using VS 6 Enterprise w/ SP5 & Windows 2000 Professional

  2. #2
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    Use the browse folder dialog box instead
    http://www.vb-world.net/tips/tip3.html


    you can use the commondialogbox to choose a folder but (I think) it's messy

    CommonDialog1.Flags = cdlOFNPathMustExist

    Mark
    -------------------

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