| | | Advanced StrataFrame User
       
Group: StrataFrame Users Last Login: Yesterday @ 8:54:38 PM Posts: 534, Visits: 2,204 |
| 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 RijoProgytech (Computer Consultants) |
| | | | 
StrataFrame Developer

Group: StrataFrame Developers Last Login: Today @ 4:58:13 AM Posts: 4,379, Visits: 4,421 |
| | 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. |
| | | | StrataFrame VIP
       
Group: StrataFrame Users Last Login: 2 days ago @ 7:31:07 PM Posts: 1,241, Visits: 3,131 |
| | 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? |
| | | | Advanced StrataFrame User
       
Group: StrataFrame Users Last Login: Yesterday @ 8:54:38 PM Posts: 534, Visits: 2,204 |
| | 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 
Edhy RijoProgytech (Computer Consultants) |
| | | | 
StrataFrame Developer

Group: StrataFrame Developers Last Login: Today @ 4:58:13 AM Posts: 4,379, Visits: 4,421 |
| 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. |
| | | | StrataFrame VIP
       
Group: StrataFrame Users Last Login: 2 days ago @ 7:31:07 PM Posts: 1,241, Visits: 3,131 |
| Thanks. That's what I've been doing, but Edhy's post got me thinking! |
| | | | Advanced StrataFrame User
       
Group: StrataFrame Users Last Login: Yesterday @ 8:54:38 PM Posts: 534, Visits: 2,204 |
| 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...
Edhy RijoProgytech (Computer Consultants) |
| | | | 
StrataFrame Developer

Group: StrataFrame Developers Last Login: Today @ 4:58:13 AM Posts: 4,379, Visits: 4,421 |
| 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! |
| |
|
|