Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Using Dialog As New OpenFileDialog With Dialog .Filter = "jpg|*.jpg|bmp|*.bmp|gif|*.gif|png|*.png" End With If Dialog.ShowDialog = Windows.Forms.DialogResult.OK Then Me.PictureBox1.Image = New Bitmap(Dialog.FileName) End If End Using End Sub
If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then Me.PictureBox1.Image = New Bitmap(OpenFileDialog1.FileName) End If