简体   繁体   中英

Dynamically change listview icon size in c#

I'm trying to make a listview with options. One of the option is to change icon size. I tried to make the change like this :

this.listview1.LargeImageList.ImageSize = this.list.SmallImageList.ImageSize = new Size(h, w);

This changed the image size, but the image disappeared. Can anyone help me ?

Please take a look at the following link, I think it should be useful:

How to Change existing Imagelist image size of Listview

use the following code. it works for me :

listView1.View = View.LargeIcon;
ImageList iList = new ImageList();
iList.ImageSize = new Size(128, 128);
iList.ColorDepth = ColorDepth.Depth32Bit;
iList.Images.Add(Properties.Resources.x64_Clear_icon); 
listView1.LargeImageList = iList;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM