I have created a folder in the resources folder (Properties.Resources). How can I use an image from there?
Usually when adding a resource, a typesafe wrapper is generated for that resource.
So say if I added an image named "picture", I could access by:
Form.picturebox1.Image = Properties.Resources.picture;
Hope this helps
edit:
After reading your post again, I think what you are saying is you added a subfolder in your solution folder under your Resources folder.
Where I wouldn't suggest doing this because it's much simpler to add a resource such as an image through the resource designer, if you are hellbent on creating a sub folder you would then have to add a line under the root tag of your .resx file that looks something like this...
<data name="picture" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\*SubDirectory*\picture.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
Where SubDirectory is replaced by the name of the sub folder you created. You should then be able to compile and then use Properties.Resources.picture as I showed above.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With