Tambahkan KOmponen Opendialog dan Picture box
Private Sub btnBrowse_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBrowse.Click
'Filter file extension
OFD.Filter = "Image Files (*.JPEG, *.jpg, *.bmp, *.gif, *.png)|*.JPEG; *.jpg; *.bmp; *.gif; *.png"
OFD.ShowDialog()
'isi textbox photo dengan path + nama file
txtPhoto.Text = OFD.FileName
txtPhoto.SelectionStart = txtPhoto.Text.Length
'jika txtphoto <> kosong ("")
If Trim(txtPhoto.Text) <> "" Then
'menampilkan gambar pada picture box photo
PbPhoto.Image = PbPhoto.Image.FromFile(txtPhoto.Text)
End If
End Sub
Private Sub btnBrowse_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBrowse.Click
'Filter file extension
OFD.Filter = "Image Files (*.JPEG, *.jpg, *.bmp, *.gif, *.png)|*.JPEG; *.jpg; *.bmp; *.gif; *.png"
OFD.ShowDialog()
'isi textbox photo dengan path + nama file
txtPhoto.Text = OFD.FileName
txtPhoto.SelectionStart = txtPhoto.Text.Length
'jika txtphoto <> kosong ("")
If Trim(txtPhoto.Text) <> "" Then
'menampilkan gambar pada picture box photo
PbPhoto.Image = PbPhoto.Image.FromFile(txtPhoto.Text)
End If
End Sub