Question How to change the image of the picturebox?

JCel

Active member
Joined
Jun 15, 2009
Messages
30
Programming Experience
Beginner
Hi all,

Could you please tell me how to change the image of the picturebox after the given button_click... also i should get the image from OpenFileDialog..
 
The PictureBox image can be changed by changing the Image property
VB.NET:
 MyPictureBox.Image = System.Drawing.Image.FromFile("C:\MyImages\image1.jpg")

The filename can be gotten from an OpenFileDialog box through the FileName property, this is assuming that .MultiSelect = false.
VB.NET:
  Dim strImageFileName As String = MyOpenFileDialog.FileName
 
Last edited:
Back
Top