Click here to Skip to main content
15,880,392 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,
I was recently thinking about a way to globally provide images for our winform applications which allows us to globally manage and change/replace images.

We have a big WinForm app that hosts multiple dlls/exes in MDI containers.
While the years passed by many developers added images to their dlls wich didn't suite any regulations.

First I thought about providing a global dll that hosts the images in a resource file and supplies them to the calling application via keys.

Then I came up with UITypeEditors that can supply images from a database using certain keys. While this seems to be a usefull approach I was still wondering if there are any good solutions around, especially when it comes to design-time support for VS2010.

Any hints/ideas on this topic are kindly appreciated,
best regards
Andy
Posted

1 solution

My approach in the past has been to create a resource library. I wrote an article about two years ago, Share Resources Across Multiple Projects[^], that might be helpful.

Basically, you create a DLL project and add all your images (and any other resources you want to share.) Then create a class with static read-only properties that export those resource images. You can create different classes to export different types of resources, such as toolbar icons, button images, etc. Then compile to create a library you can link in to your projects.
 
Share this answer
 
v2
Comments
Dalek Dave 5-Nov-10 12:01pm    
Good call.
hoernchenmeister 8-Nov-10 3:20am    
Thanks dude, I'll go for this approach ;)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900