I’m developing a VB.NET WinForms application, and I’m using lots of small 16×16 32bit icons everywhere; most of which are nested behind tabs or otherwise invisible. I’m putting all of them in one big ImageList control, it seems easier to manage them from there.
My question is, is this smart? I’m using the imagelist even in buttons, and controls that could otherwise have an image assigned more directly (e.g., through the Image property).
Note that I use ImageKey and have no (current) need for ImageIndex.
Does it have a negative/positive effect on performance?
Unless you have a billion icons, you’re not likely to have any problems with storage or performance.
Really it comes down to the organisational approach you find easiest. Sometimes a shared repository is convenient, but it can be a hassle if the resources for a control are stored in an unrelated location.
In general I’d just drop the icons into your resources and then set the Icon/Image property on your controls to point at them – this is just a much easier way of managing the resources. But if you find your approach easier (having tried out the alternatives), then go for it.