in vb window
Private Sub btnBrowse_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBrowse.Click
Dim OpenFileDialog1 As New OpenFileDialog
With OpenFileDialog1
.CheckFileExists = True
.ShowReadOnly = False
.Filter = "All Files|*.*|Bitmap Files (*)|*.bmp;*.gif;*.jpg"
.FilterIndex = 2
If .ShowDialog = Windows.Forms.DialogResult.OK Then
' Load the specified file into a PictureBox control.
PhotoPictureBox.Image = Image.FromFile(.FileName)
TextBox1.Text = OpenFileDialog1.FileName.ToString()
End If
End With
End Sub
in C# window
private void btnBrowse_Click(object sender, EventArgs e)
{
if (customeropen.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
txtCustomerPhoto.Text = customeropen.FileName.ToString();
pccustomerphotosample.Image = Image.FromFile(customeropen.FileName);
}
}
:)