Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB. NET image Control

Status
Not open for further replies.

swabyw

Programmer
Feb 11, 2009
2
US
I need to place a image on my form. During run time the image should change to fit the selection of the user. In older version of VB I load the image from a file example,
imgName.Picture = "C:\Application\picture\picture.jpg" which would load the appropriate picture to the image box which can be one of fifty pictures depending on the selection. Now I dont know to do it with the picturebox that is in VB.NET 2010. I tried all that I know but no use. Does anyone have any idea.

Thanks in advance
swabyw
 
Are you creating a WinForms app or a WPF app?

I use VS2008, but it shouldn't be too much different.

If WinForms, you would most likely be using a PictureBox control, and can set it with:
Code:
imgName.ImageLocation = "C:\Application\picture\picture.jpg"

If you are using WPF, then I would need to look into this a little more.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top