列表视图多图像列表和图标/图片列表、多图、视图、图标

2023-09-05 00:42:43 作者:盖世英雄少女心

我需要一种方法来使用两个图像列表上的列表视图。图像列表之一,如果对包含16×16的图标头图标,另一个将包含分项内32×32缩略图。

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.

图片下方显示了我想做

推荐答案

我发现了一个窍门解决了问题。关键是要建立一个32 * 32帆布一个16x16的图标,并居中。这是因为将缩略图大小为32位最大 所以我有一个图像列表16pix is​​onc,另一个用于32pix图标

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

当需要的缩略图,我只需要设置小图标来32pix。

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