listview with multiple imagelist and icons/image

2019-07-06 12:46发布

i need a way to use two imagelist on a listview. one of the image list if for header icons which contain 16x16 icons, and another will contains 32x32 thumbnail pictures within the sub items.

The image below shows what am trying to do

listview with hearder icons and thumbnail

1条回答
ゆ 、 Hurt°
2楼-- · 2019-07-06 13:23

i found a trick which solves the issue. the trick is to create a 16x16 icon on a 32x32 canvas and center it. this is because the thumbnail size is 32bit max. so i have one image list for 16pix isonc and another for 32pix icons

when thumbnail is needed, i only need to set the small icons to 32pix.

this support built it i only had to do this

' for the header columns
Set ListView1.ColumnHeaderIcons = ImageList1
' for the items and sub items
Set ListView1.SmallIcons = ImageList2

thanks for all your inputs

查看更多
登录 后发表回答