Promote Your Blog

Friday, March 2, 2012

How To Display Selected Picture in

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)


MsgBox(“You Approp. Msg”)

End If

No comments:

Post a Comment