You can use your open file dialogue box again to specify an image for the user to select.
Dim strFileName As String
openFD.InitialDirectory = "C:\"
openFD.Title = "Open an Text File"
openFD.Filter = "Text Files|*.txt"
Dim DidWork As Integer = openFD.ShowDialog()
Change the Title property to this:
openFD.Title = "Open an Image"
And change the Filter property to this:
openFD.Filter = "jpegs|*.jpg|gifs|*.gif|Bitmaps|*.bmp"
Run your code and click your View Images menu item. You should see the Open dialogue box appear.
You should now be able to see only the three image formats we've specified.
To insert an image into your Picture Box, some new code is needed.
Add the following code below :
If DidWork <> DialogResult.Cancel Then
strFileName = openFD.FileName
PictureBox1.Image = Image.FromFile(strFileName)
openFD.Reset()
End If