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;
            }
          
        }

源代码下载

 

posted @ 2010-02-15 12:12  猪悟能  阅读(4956)  评论(0编辑  收藏  举报