Question Changing image in picture box

Necrovore

New member
Joined
Nov 27, 2011
Messages
2
Location
Bangalore
Programming Experience
Beginner
Hello,
I am presently working on a project on vb.net. And am not so sure how to change the image in the picture box because of the constraint i have in the code.

In a nutshell. i have an array of 52 elements (0 to 51). i have images in my resources named _0,_1..... _51. now depending on the value in the array element i want to change the image on the picture box. That is, if a(0) is 8 i want _8 to be on the picture box. I have tried the same by using string concatenation but does not work.
 
Alternative

If the retrieval from resources is not possible give me an alternative for this statement

picturebox1.Image=Image.Fromfile("C:\...........\1.png")

Is there a way i can access the image without giving the entire path.
I tried giving

picturebox1.Image=Image.Fromfile("WindowsApplication1\images\1.png") but this is giving me a file not found exception.
 
Back
Top