StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



How to re-use an imagelist control?Expand / Collapse
Author
Message
Posted 06/09/2008 2:55:35 PM
Advanced StrataFrame User

Advanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame User

Group: StrataFrame Users
Last Login: Today @ 12:59:18 AM
Posts: 633, Visits: 2,606
Hi, it is possible to have a global image list I could re-use in different forms?

For some task I am saving the images in the project's Resource, but some controls like the ListView requires an ImageList control and I don't want to have to enter all images used by several forms in several ImageList controls.

 
Post #16930
Posted 06/10/2008 9:09:04 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Today @ 4:11:57 AM
Posts: 4,586, Visits: 4,570
Sure, just create a resource file or use the resources in the project itself.  If you just right-click and add a new item, then select Resource File.  Then once in your project, add a new item to the resource file and select the image(s) that you want.  Also, be sure to set the imported images to Embedded instead of Content.  At this point, you can choose a local resource from anyplace within your project and select from that resource file.
Post #16958
Posted 06/10/2008 12:02:33 PM
StrataFrame VIP

StrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIP

Group: StrataFrame Users
Last Login: 2 days ago @ 7:28:14 PM
Posts: 1,280, Visits: 3,259
Is there any way to do this across a solution? I.e. have a resource file that is accessible from all the projects in a solution?
Post #16966
Posted 06/10/2008 12:16:00 PM
Advanced StrataFrame User

Advanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame User

Group: StrataFrame Users
Last Login: Today @ 12:59:18 AM
Posts: 633, Visits: 2,606
Thanks Trent,

I will try the resource file, but how to use those images in the resource file in the ListView, since this controls requires an ImageList controls to refer to?

All I want to do is not having to add imagelist controls all over the app and use a single ImageList or Resource file for all my images for this project.  I hope this could be done since I hate to keep doing the same thing over and over and over

 
Post #16967
Posted 06/10/2008 1:22:03 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Today @ 4:11:57 AM
Posts: 4,586, Visits: 4,570
Greg:

Is there any way to do this across a solution? I.e. have a resource file that is accessible from all the projects in a solution?

Not easily.  Really it is best to setup this up by project.

I will try the resource file, but how to use those images in the resource file in the ListView, since this controls requires an ImageList controls to refer to?

We never use the designer for the ImageList control anyway as after a few compiles, the quality of the image degrades.  So when we use an ImageLIst control, we add a method that we call in the constructor or OnLoad that populates the image list from resource images...this way the images will always remain crisp and clean.

Post #16971
Posted 06/10/2008 2:33:27 PM
StrataFrame VIP

StrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIP

Group: StrataFrame Users
Last Login: 2 days ago @ 7:28:14 PM
Posts: 1,280, Visits: 3,259
Thanks. That's what I've been doing, but Edhy's post got me thinking!
Post #16973
Posted 06/10/2008 3:34:58 PM
Advanced StrataFrame User

Advanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame User

Group: StrataFrame Users
Last Login: Today @ 12:59:18 AM
Posts: 633, Visits: 2,606
Trent L. Taylor (06/10/2008)
So when we use an ImageLIst control, we add a method that we call in the constructor or OnLoad that populates the image list from resource images...this way the images will always remain crisp and clean.

Well that would be what I am looking for because in that case all my images will be in the common Resource File and then the image list would be programatically be filled with the images needed from the resource file. Could you share some code on how to import the images from the resource file?

Also that could be a new SF ImageList control in future updates...

 
Post #16975
Posted 06/10/2008 4:27:01 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Today @ 4:11:57 AM
Posts: 4,586, Visits: 4,570
Also that could be a new SF ImageList control in future updates

If it were that simple we would have already done it.  This will require that we replumb the ListView, etc.  At present this is still standard .NET logic.  Trust me, this has already crossed our minds hundreds, it not thousands of times!

Post #16976
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ben Chase, Trent L. Taylor, Steve L. Taylor

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 9:30am

Powered by InstantForum.NET v4.1.4 © 2008
Execution: 0.094. 10 queries. Compression Enabled.
Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.