Search code examples
visual-studio-2008embedded-resource

Where to store images correctly in VS 2008 project?


I am learning how to use VS 2008 for building projects. I would like to embedd images which my app is using internally. What is the correct way? I know I can create a folder in my project but not sure how to access the file stored there, then.


Solution

  • A default win forms application adds a resource file to the solution. If you open it you can drag files onto it, and assign a name. Then access it in code like below

    Properties.Resources.MyResourceName;
    

    Default resource file:

    Resource file