CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Browse for File

  1. #1
    Guest

    Browse for File

    How would I go about creating a Browse for File dialog box? I'm currenting using a Browse for Folder dialog box which works great but I have a need to browse for a file. I would like to be able to browse for a file and have the path and filename enter into a text box.


  2. #2
    Join Date
    Aug 1999
    Posts
    11

    Re: Browse for File

    Use the CommonDialog control to display the Standard Open dialog box.
    Need to include component "Microsoft Common Dialog Control 5.0 "


    '=======================================================================
    ' PROCEDURE : FileOpenProc()
    ' Purpose : Displays standard Open dialog box to find a file
    ' PARAMETERS : none
    '=======================================================================
    Public Sub FileOpenProc()

    On Error Resume Next
    Dim sFileName As String

    FileOpenDialogBox = ""
    CMDialog1.filename = ""
    CMDialog1.ShowOpen

    If Err <> 32755 Then ' User chose Cancel.

    sFileName = CMDialog1.filename
    End If
    End Sub


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