listview与多个imagelist和图标/图像

时间:2012-11-03 05:37:07

标签: .net listview vb6 thumbnails imagelist

我需要一种在listview上使用两个imagelist的方法。其中一个图像列表,如果标题图标包含16x16图标,另一个将包含子项目中的32x32缩略图。

下图显示了我想要做的事情

listview with hearder icons and thumbnail

1 个答案:

答案 0 :(得分:1)

我发现了一个解决问题的技巧。诀窍是在32x32画布上创建一个16x16图标并将其居中。这是因为缩略图大小最大为32位。 所以我有16pix isonc的一个图像列表和32pix图标的另一个图像列表

当需要缩略图时,我只需要将小图标设置为32pix。

这种支持构建它我只需要这样做

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

感谢您的所有投入