Image Resourses using VS2005 and .resx file

  • Thread starter Michael Poirazi
  • Start date
M

Michael Poirazi

Hello
I am trying to include some images in my applications resources.
1. Create New Item (Resource File) for my Project
2. Set the name to NetRes.resx
3. Add an image , set the name to Error (it is a .png file)
4 . Put this code
ResourceManager rm = new ResourceManager("NetRes", this.GetType().Assembly);

pictureBox1.Image = (Image)rm.GetObject("Error");

5. I get an error message to check my satellite assemlies.

What am I doing wrong here? Any help ?

Regards.

Mike
 
M

Michael Poirazi

Anyone ?

Michael said:
Hello
I am trying to include some images in my applications resources.
1. Create New Item (Resource File) for my Project
2. Set the name to NetRes.resx
3. Add an image , set the name to Error (it is a .png file)
4 . Put this code
ResourceManager rm = new ResourceManager("NetRes",
this.GetType().Assembly);

pictureBox1.Image = (Image)rm.GetObject("Error");

5. I get an error message to check my satellite assemlies.

What am I doing wrong here? Any help ?

Regards.

Mike



--
 
M

Matt

Michael said:
Hello
I am trying to include some images in my applications resources.
1. Create New Item (Resource File) for my Project
2. Set the name to NetRes.resx
3. Add an image , set the name to Error (it is a .png file)
4 . Put this code
ResourceManager rm = new ResourceManager("NetRes", this.GetType().Assembly);

pictureBox1.Image = (Image)rm.GetObject("Error");

5. I get an error message to check my satellite assemlies.

What am I doing wrong here? Any help ?

You need to generate the resource file (.resource) first.

In a DOS box, set the path to include the VC# directory (usually
Program Files\Microsoft Visual Studio .NET 2003\VC#) and type:

resgen NetRes.resx NetRes.resources

Copy the .resources file to whereever the program is, and run it.

Matt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top