Discussion:
Loading Images into an ImageList Control
(too old to reply)
HLong
2008-02-27 19:04:02 UTC
Permalink
Can someone explain how could I load images from a folder into the ListImages
collection of an ImageList control. I am working on VBA. On my form I have
a button to lunch the GetOpenFileName dialog to select the image files.
These image files could be in JPG, PNG, TIFF, BMP file formats (preferably),
but I could have them on BNP only if required. Thanks.
MikeD
2008-02-27 21:04:26 UTC
Permalink
Post by HLong
Can someone explain how could I load images from a folder into the ListImages
collection of an ImageList control. I am working on VBA. On my form I have
a button to lunch the GetOpenFileName dialog to select the image files.
These image files could be in JPG, PNG, TIFF, BMP file formats
(preferably),
but I could have them on BNP only if required. Thanks.
I don't think I'd use an ImageList for this, particularly under VBA. If I
were doing this with VB6, I'd probably use an array or collection of
StdPicture objects and LoadPicture each picture to an instance of that
object. I also probably only do this if the number of pictures was
relatively small because it could potentially eat up a lot of memory if
you've got a lot of them loaded.

The ImageList control is basically intended to store icons or small bitmaps
to be used with a ListView and/or TreeView and/or ImageCombo control.

You'd be better off asking this in a VBA newsgroup for the product you're
using (for example: microsoft.public.word.vba.general,
microsoft.public.office.developer.vba, microsoft.public.excel.programming).
--
Mike
Microsoft MVP Visual Basic
Continue reading on narkive:
Loading...