Results 1 to 3 of 3

Thread: Picturebox

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2006
    Posts
    143

    Picturebox

    How would I add a browse button so the user can search for an image, the image is added to a picture box and the image path is displayed in a textbox?

  2. #2
    Frenzied Member Jmacp's Avatar
    Join Date
    Jul 2003
    Location
    UK
    Posts
    1,959

    Re: Picturebox

    Put a commondialog control on your form and add this code.

    VB Code:
    1. Private Sub Command1_Click()
    2.  
    3.     With CommonDialog1
    4.        .Filter = " image files (*.bmp,*.jpg,*.pcx)|*.BMP;*.JPG;*.PCX|"
    5.         .ShowOpen
    6.         If .FileName = vbNullString Then
    7.             Exit Sub
    8.         End If
    9.         Text1.Text = .FileName
    10.         Picture1.Picture = LoadPicture(.FileName)
    11.     End With
    12.  
    13. End Sub

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jan 2006
    Posts
    143

    Re: Picturebox

    Thanks!

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