Application-wide imagelist?

BadgerByte

Well-known member
Joined
Aug 5, 2005
Messages
194
Location
Ipswich, UK
Programming Experience
5-10
Hey all,

We have an ageing application which I'm updating for graphics / efficiency.
The application is very large containing many forms often using the same icons / images, each has it's own imagelist.

Questions:

Is it possible to create an application wide imagelist which will work in design time?

Does it have implications for the size of the application to have an image list on each form, or do matching images all use the same resource?

Are there any other techniques for improving the ease with which I can change the whole look of the application?

Any help greatly appreciated,

Regards,

Andy
 
So if i'm understanding correctly...

Are you trying to achieve a themed look for the application, i.e be able to change one property and this will imapct the whole the application? and that you are trying to also store a set of standard images somewhere for the application to use?
 
Thats pretty much it, I'm not so worried about theming on the users side, rather making it easier to change all the icons / images developer side (for example if I need to rebrand the software for a reseller).

Basically would like to have all my images / icons in one place, but still have it work at design time.

Any help would be greatly appreciated.

Regards,

Andy
 
I have to admit that I don't have the time to test this theory of mine
before posting this, so judge this as a theory/psuedocode entry. The
idea is to have an own class that can handle the imagelist, and that
way build your own theme based engine.

VB.NET:
Public Class clsImageHandler

    Private imageList As New ImageList

    Public Sub addNewImage(ByVal imageKey As String, ByVal image As Image)
        imageList.Images.Add(imageKey, image)
    End Sub

    Public Function getImage(ByVal imageKey As String) As Image
        Return imageList.Images(imageKey)
    End Function

End Class

If this won't be possible, then someone correct me. It's merely as I
said a theory and would need some testing before it could be accepted
as a answer.
 
Ah, I wasn't aware of that, then there is no need to re-invent the wheel
as someone already made a complete sollution already. Better to go
with the tested approach than with a new approach, unless you require
some quite special setting that isn't possible with the sollution that already
exists. But if I understood your question right, then that won't really be
an issue.
 
Back
Top