listview & imagelist

24sharon

Registered User.
Local time
Today, 11:01
Joined
Oct 5, 2004
Messages
147
hello,

I try to insert images to a listview.

and alltime same error:
imagelist must be initialized before it can be used

if I write:
ListView0.ListItems.Add , , "abc"
it good and the value insert

but if I change to
ListView0.ListItems.Add , , "abc", "img1"
I got the error,
<pic1>

I tryed download an example from the web, and its work.
<pic2> - my form
<pic3> - the file from the web.

what can I do to fix it and also MY FORM recognize the IMAGES
thank for all advice
s.
 

Attachments

  • untitled.JPG
    untitled.JPG
    62.7 KB · Views: 238
Hi,

I think you need to initialise the imagelist associated with the listview in code:

Me.ListView0.SmallIcons = Me.ImageList.Object

and then:

Me.ListView0.ListItems.Add , , "abc", "img1"


Least ways that's what works for me!

HTH.
 
thanks I got it!

dont know how but after some playing with it I got it.

thanks
 

Users who are viewing this thread

Back
Top Bottom