this is my first question here.
I’ve made a small quiz project about the 199 world’s states via Visual Studio C#.
therefor I collected all flags of every country and put them into a folder – you can imagine that i collected MANY.
To run my current project i need the folder with all these .gif images –
otherwise the startup will end in a fatal error. 🙁
My question is if it is possible to integrate the images into my .exe file so that i can run it without that nasty folder. (Also important for future project with even more content!)
And if it is possible – how?
It would also be nice if you let me know how to use the images – what pathes they have got etc … =)
Thanks in advance!
Robbepop
You can add a resource file to your application, by going to
You can then simply add any image to your application and reference it via your code. Select
Imagesfrom the drop down on the top of the menu, and then clickAdd Resource >> From existing file.After you save your resource file, you can then access your images via code, e.g.
However, with the number of images you have, and what I would believe you are using them for, I would suggest using a
Image List, which you can add all of your images to, and access them via their key or index. e.g.Or
This can be found in your toolbox.