tags:

views:

35

answers:

2

I have a C# WinForm application that has a few images on it.
I can specify the image location, but what I want is for the image to go with the file after it publishes. It still displays the one specified in the image location, so if a user doesn't have access to that location, he/she won't be able to see the image.

+4  A: 

The magic word you're looking for is "resources". Have a look at the MSDN article on Adding and Editing Resources.

Thomas
+1  A: 

In addition to Thomas link, you can try the following:

Add an Image into your form. Change in the properties "Build Action" field. The Build Action property indicates what Visual Studio does with a file when a build is executed. Build Action can have one of several values:

  • None - The file is not included in the project output group and is not compiled in the build process. An example is a text file that contains documentation, such as a Readme file.
  • Compile - The file is compiled into the build output. This setting is used for code files.
  • Content - The file is not compiled, but is included in the Content output group. For example, this setting is the default value for an .htm or other kind of Web file.
  • Embedded Resource - This file is embedded in the main project build output as a DLL or executable. It is typically used for resource files.
serhio