In this post, you will learn, how to:
- Use OpenFileDialog to choose Jpeg files only
- How to display selected jpg image
OpenFileDialog2.InitialDirectory = Directory.GetCurrentDirectory
OpenFileDialog2.Title = "Select a File"
OpenFileDialog2.FileName = ""
OpenFileDialog2.Filter = "Jpeg Files (*.jpg)|*.jpg"
OpenFileDialog2.FilterIndex = 1
If OpenFileDialog2.ShowDialog() <> Windows.Forms.DialogResult.Cancel Then
PictureBox1.Image = Image.FromFile(OpenFileDialog2.FileName)
Else
MsgBox(“You Approp. Msg”)
End If
0 Comments