I'm trying to access image resources in my application, but I can't the resources from the application, I just end up with null. I've added the resources in the properties section in visual studio 2008, and the code I'm using is
private ResourceManager res = new ResourceManager("MyNameSpace.Properties.Resources", System.Reflection.Assembly.GetExecutingAssembly());
Image myImage = (Image)res.GetObject("myImage.png");
But myImage is always null. I know I could use MyNameSpace.Properties.Resources.myImage.png, but I need to get the resource from a string.
Icons from resource name
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Sateesh ArvetiRank #96 · 22.3K reputationPosted Jul 15, 2008, 10:21 PM EDT
R u sure that ur resource name is myImage.png.What i suppose is,resource name is wrong.plz check it once,whether resource name is correct or not for that Image in Resources.resx once.
Bill15 reputationPosted Jul 15, 2008, 11:52 PM EDT