ImageList Control

K

Klatuu

Using 2003, XP Pro.
Trying to add images using Microsoft ImageList Control 6.0

According to information I have, you use the .Add method to add an image to
the list. The Add method is not available for this control. It does not
show up in intellisense and when I code it and run it, it thows the error
that the method is not supported for this object.

So, how do I add images to an imagelist?
 
R

Rob Parker

Hi Dave,

It took a while, but I finally got there (XP Pro, Access 2002 - I expect it
should work in A2003) ...

Dim imlx As Object 'declaring ListImage gives type mismatch in
ListImages.Add statement
Set imlx = ImageListControlName.ListImages.Add(, ,
LoadPicture("C:\Documents and Settings\Rob\My Documents\My
Pictures\rpp.bmp"))

The (missing in my example) optional parameters in the .Add method are Index
and Key.

I got there with help from
http://msdn2.microsoft.com/en-us/library/aa443198(VS.60).aspx

I expected that
Me.ImageListControlName.ListImages.Add (, , LoadPicture("C:\Documents
and Settings\Rob\My Documents\My Pictures\rpp.bmp"))
should work, but it doesn't. Go figure ;-)

HTH,

Rob
 
K

Klatuu

Thanks, Rob. I will give it a try later today. The link you posted came
back with "Content Not Found"
 
R

Rob Parker

Hi Dave,

The link (direct from my posted message) still works for me. If you
want/need to find it manually, it's in the MSDN Library:
Development Tools and Languages - Visual Studio 6.0 - Visual Basic 6.0 -
Product Documentation - Reference - Language Reference - Methods - Add
Method (ListImages Collection)

BTW, the imagelist control does not show the added image(s) if you
subsequently open it in design mode; it may do that if you include the
acSaveYes parameter in the form's close event.

Again, HTH,

Rob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top