my app creates some components at runtime such as a PictureBox.
Because they are only created at runtime I have no way of setting the ErrorImage through the properties section.
I thought I could just add the images I required to the programs resx file but found out that that is rewritten at compile time and clears out 'dirty' resources, like my manually added images.
OK, I thought, I'll just create my own resx file and add the images to that, which I did.
The issue I have now is how to actually call the images from the newly created resx file.
I found some code on the net but cannot get it to work:-
ResourceManager MIrm = new ResourceManager ("MyImages", Assembly.GetExecutingAssembly()); pb.ErrorImage = ((System.Drawing.Image)(MIrm.GetObject("pb.ErrorImage")));
my resx file is called MyImages.resx & I have an image in it called pb.ErrorImage.
When using the above code I receive an error:-
System.Resources.MissingManifestResourceException: could not find any resources appropriate for the specified culture...... etc.
Also, I cannot really seem to find out exactly where my resx file is supposed to be in the Project tree, at the moment it is located inside of the Properties folder.
Any help would be appreciated.