Shiroy
Shiroy

Reputation: 1828

C# ListView image icon size

The icons in the ListView in C# are very small by default (probably 16x16px). How can I increase the size of these icons?

I tried making the source images in the ImageList larger, and also tried using the LargeImageList property, but to no avail.

I'm using C#, WinForms and .net 4.0.

Upvotes: 10

Views: 21207

Answers (2)

Shiroy
Shiroy

Reputation: 1828

The trick is in modifying the ImageSize propertiy of the ImageList (who would've thought)?

        listView1.View = View.LargeIcon;

        ImageList iList = new ImageList();
        iList.ImageSize = new Size(64, 64);  
        iList.ColorDepth = ColorDepth.Depth32Bit;

        listView1.LargeImageList = iList;

As a bonus, remember to set the View property of the ListView to be LargeIcon and also increase the ColorDepth (if you so desire).

Upvotes: 28

Related Questions