Referring to project resource

Blake81

Well-known member
Joined
Feb 23, 2006
Messages
304
Location
Georgia, USA
Programming Experience
1-3
This is probably a really simple question, but I want to add JPG files to my project resources because I think it will eliminate some problems with file paths. How do you refer to a file in the project resources to make it the image for a Picture Box? Thanks.
 
If you added image.jpg you could probably get itwith code: My.Resources.image
Just check what name is given when you add it.
 
Thanks. I figured it out right after I posted. I need to figure something else out and VB won't let me do it the way I planned. I have a bunch of icons with names like 1.jpg, 2.jpg, etc. and the icon I show depends on the value of specific XML inner text. I wanted to do something like "Image 1 = My.Resources. & Xnode.InnerText", but it gives me an error because it expects something after the . after Resources. How can I handle this? Thanks.
 
My.Resources.ResourceManager.GetObject("name")
 
Back
Top