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?
Printable View
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?
Put a commondialog control on your form and add this code.
VB Code:
Private Sub Command1_Click() With CommonDialog1 .Filter = " image files (*.bmp,*.jpg,*.pcx)|*.BMP;*.JPG;*.PCX|" .ShowOpen If .FileName = vbNullString Then Exit Sub End If Text1.Text = .FileName Picture1.Picture = LoadPicture(.FileName) End With End Sub
Thanks!