How to re-use an imagelist control?


Author
Message
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
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!

Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
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...Hehe

Edhy Rijo

Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.3K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Thanks. That's what I've been doing, but Edhy's post got me thinking! BigGrin
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
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.

Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
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 Wink

Edhy Rijo

Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.3K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
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?
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
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.
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
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.

Edhy Rijo

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search