|
-
Mar 27th, 2025, 04:08 PM
#11
Junior Member
Re: CommonControls (Replacement of the MS common controls)
I have a problem with ListView and ImageList, Im stuck, I tried the most simple, I use a ImageList with just 1 image, then I remove the image and add another, it is always 1 index, I update the image so I can put diferent icon for diferent file in ListView
example:
Set LVitem= ListView1.ListItems.Add(, , "item1", , 1)
LVitem.SubItems(1) = "SubItem1"
ImageList1.ListImages.Remove (1)
Call ImageList1.ListImages.Add(1, , Form1.Picture1(1).Image)
Set LVitem= ListView1.ListItems.Add(, , "item2", , 1)
LVitem.SubItems(1) = "SubItem2"
ImageList1.ListImages.Remove (1)
Call ImageList1.ListImages.Add(1, , Form1.Picture1(2).Image)
Icons in listview will be all the same, they will be Form1.Picture1(2).Image, the last image updated in ListView, even if the image is replaced after creation of the Item
so the only way to have diferent icons for diferent items in ListView is to assing diferent index, and grow the ImageList, but this is not the proper way for an explorer with files
or maybe is just that I dont know how to do it or Im missing anything, anu idea please?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|