Results 1 to 3 of 3

Thread: Opening a Existing file

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Sep 1999
    Location
    Phoenix, az
    Posts
    1,517

    Post

    Hi,

    This is something I dont understand.. AT ALL.
    I even have a example I cant figure it out ( the guy wrote it WAY above me)

    So could someone give me a SIMPLE example of how to open a BMP file from the computer ( so that the user picks the file)

    Help please?

  2. #2
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Post

    Sure. Add Microsoft CommonDialog Control, PictureBox and Command Button to your form. Change the AutoSize property of the PictureBox to TRUE. Put this code on Button's Click event:

    Code:
    Private Sub Command1_Click()
        Dim strPath As String
        
        On Error Resume Next
        
        With CommonDialog1
            .Filter = "Bitmap Files (*.bmp)|*.bmp"
            .ShowOpen
            If Err.Number = cdlCancel Then Exit Sub
            strPath = .FileName
        End With
        Picture1.Picture = LoadPicture(strPath)
    End Sub

    Regards,



    ------------------

    Serge

    Software Developer
    [email protected]
    [email protected]
    ICQ#: 51055819


  3. #3
    Addicted Member
    Join Date
    Nov 1999
    Posts
    184

    Post

    THANK YOU SO MUCH!!!!

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