C# listView载入图片以大图标方式显示

演示了imageList 和 listView的大图标模式,关键代码见下面:

 p rivate void button1_Click(object sender, EventArgs e)
        {
            imageList1.ColorDepth = ColorDepth.Depth24Bit;
            imageList1.ImageSize = new Size(120, 120);
            for (int i = 0; i < 12; i++)
            {
                imageList1.Images.Add(Image.FromFile(Application.StartupPath + "\\"+(i+1).ToString()+".jpg"));
                listView1.LargeImageList = imageList1;
                listView1.Items.Add("韩版服装"+(i+1).ToString());
                listView1.Items[i].ImageIndex = i;
            }
          
        }

源代码下载

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-09-03
  • 2022-12-23
  • 2022-12-23
  • 2021-12-24
  • 2022-12-23
猜你喜欢
  • 2021-10-21
  • 2022-12-23
  • 2022-12-23
  • 2021-07-08
  • 2021-12-16
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案