1
我试图在列表视图处于活动状态并且包含项目时更改图像列表图像大小。但它似乎只影响新添加的图像,现有的图像将变为空白。如何更改列表视图的现有图像列表的图像大小
这里是我的代码:
public Form1()
{
...
imglst_ = new ImageList();
imglst_.ImageSize = new Size(80, 80);
listView1.SmallImageList = imglst_;
listView1.LargeImageList = imglst_;
...
}
//zoom in
//This code only affect the new added image
//the existing images will become blank
private void toolStripZoomin_Click(object sender, EventArgs e)
{
int w = imglst_.ImageSize.Width;
int h = imglst_.ImageSize.Height;
w = (int)(w * 1.2);
h = (int)(h * 1.2);
imglst_.ImageSize = new Size(w, h);
}