Groups | Blog | Home
all groups > c# > february 2006 >

c# : Image Resourses using VS2005 and .resx file


Michael Poirazi
2/5/2006 11:14:27 PM
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

Michael Poirazi
2/7/2006 3:23:51 AM
Anyone ?

[quoted text, click to view]



--
Matt
2/7/2006 5:15:28 AM

[quoted text, click to view]

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

[quoted text, click to view]
AddThis Social Bookmark Button