(Mike Mitchell)
7/21/2011 5:49:00 AM
On Wed, 20 Jul 2011 17:15:07 -0400, "MikeD" <nobody@nowhere.edu>
wrote:
>
>
>"MM" <kylix_is@yahoo.co.uk> wrote in message
>news:09ae27pee1hrn80h6pqr91sa7cj8430vfb@4ax.com...
>>
>> Then I adopted your approach: I placed three image controls on the
>> form and put the relevant icon (with 256 colours) in each one (at
>> design time). Then in Form_Load I load the ImageList:
>>
>> SmallImages.ListImages.Add , "fail", imgFail.Picture
>> SmallImages.ListImages.Add , "partial", imgPartial.Picture
>> SmallImages.ListImages.Add , "success", imgSuccess.Picture
>>
>
>It probably wouldn't make all that much difference with only 3 images, but
>instead of using Image controls you might want to put your icons in a
>resource file and then use LoadResPicture to assign from the resource to
>your ImageList. If you had a lot of images (intentionally arbitrary since "a
>lot" means a different number to different people), this would definitely be
>a better approach. At the very least, though, you should be using a control
>array for your Image controls. Define constants to use for the index of
>each Image control in the control array. If you do decide to go with the
>icons in a resource file, use the same numeric value for the icon resource
>ID as the index of the Image control in the control array. That'll make
>things easier (for example, you can then use a loop). You could get by with
>having only one Image control on your form at design-time and load
>additional Image controls into the control array at runtime. But again,
>with only 3 images, not a big deal to do things this way.
Oh, indeed I totally agree with your comments, thanks BTW. The three
image controls I whacked onto the form were just a quick and dirty
solution to see whether it would work. In addition to your suggestions
(although I've used resource files in the past and find them usually a
PITA to implement), there's also a PictureClip control I seem to
recall that I haven't used for ages. (Although on just reading up
about it a few moments ago, it also seems like another PITA.) The
resource file approach looks like the most sophisticated solution
really.
But, yes, there are only a few images in this app. Yesterday I started
looking at vbaccelerator's replacement ImageList control, then read
the small print that it's not suitable as a plug-in replacement for
the MS ListView or TreeView, but only for Steve's own vbaccelerator
alternatives.
MM