Fixed all problems with inconsistent indexes being returned by the methods. Indexes returned by the control are now always 1-based. The ItemPicture method consequently now works correctly.
vbAccelerator ImageList Control and Class v2.0
Use COMCTL32.DLL directly to create an ImageList and take full control of icons at all colour depths and sizes.
As a number of my controls require image list support (Rebar and Toolbar control, Tab Control, S-Grid, Icon Menu Control, ActiveX Popup Menu DLL, Owner Drawn ComboEx Control and the Owner Drawn Combo and List box Control), it was about time I provided an Image List control to support them, so you don't have to distribute 590kb of COMCTL32.OCX just to get images in your app.
Well here it is. I completed the control, and it has a full design-time interface (see above) with a number of new features which you will probably find very useful if you're used to the MS version. But, having done it I was alarmed to discover than my OCX was 131kb! The problem is with this control is you need nice serialisation code and property page support otherwise it isn't any use. But the penalty of this is that you are bound to end up with something heavier than if you go the code-only route.
Another option if you are interested in lean, serious code is to get all the functionality from a class, which will add just 30kb of code to your project. There's no subclassing or hooky API calls, so there's no danger of making your project unstable in the IDE by adding it. You can load all the icons in one go from a picture strip containing all the images in series (stored as a file or a resource bitmap). The control version lets you create a picture strip and save it and then you ditch the control and use the class instead. A bit of an expensive use of a control, but anyway...
Note that this control isn't a direct replacement for the Common Controls version. You can't directly attach it to a MS TreeView or ListView etc and get that to work. It does, however, directly attach to all the vbAccelerator controls that require an ImageList (note that they also support the MS ImageList). Just pass the return value of the hIml property to the relevant ImageList method.
The features of this image list control are:
To get a feel for the methods and use of the image list, download one of the sample files and check it out.