Tuesday, October 28, 2008 1:01 PMHi everyone
I create a windowsControlLibrary and Add a ResourceFile to it.
next Add an image to resource file and Build The dll file.
next I Adding this dll to a Windows Forms Application.
now,i want to use image that stored in dll resource.
My dll name is: MyDll.dll
My resource file name is: MyResource.resx
i need a suitable source code!
enyone can help me?
Tuesday, October 28, 2008 1:35 PMModeratorLet's think this problem through. When you added the images to the DLL they were added to Properties. When you browse the DLL in the Object Browser Window, you should see the Properties Folderm which contains 2 classes; Resources and Settings. Your images are saved as a regular C# property within Resources.
That is how a file named Blank.bmp would look. Notice that it is declared "internal", just like the containing class Resources. That means the class and its' properties are not "public". You will need to expose them as public to access them from other assemblies.
I would create a class that served just that purpose. It should be pretty easy to do. Just like exposing controls on a form as public properties. Just use a separate class to expose the Resources.
Mark the best replies as answers. "Fooling computers since 1971."