ICO files in image list used with listview

Saga 426 Reputation points
2022-04-14T00:38:28.497+00:00

Hi all. I am using VS2019 C# with Windows 10 x64.

I am looking into the listView control. I've got it work, no prob. I "linked" an image list to it to display icons in the list view. I loaded the image list with ICO files that contain 24x24 and 48x48 icons, planning to make use of the Small and Large icon options.

How do I access the 24x24 or 48x48 icons depending on the listview view type?

I found the following:

https://social.msdn.microsoft.com/Forums/en-US/9c0d20fe-b41d-44b1-b202-0a2422119e2d/imagelist-ico-files-how-to-specify-which-image-since-there-are-multiple-in-the-one-ico-file?forum=winforms

But I hope that fater 12 years, there is a better practice to accomplish this. Thanks! Saga

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,483 questions
0 comments No comments
{count} votes

Accepted answer
  1. Castorix31 82,326 Reputation points
    2022-04-14T18:47:01.133+00:00

    You can see this article for example : C# ListView

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Karen Payne MVP 35,286 Reputation points
    2022-04-14T01:00:19.907+00:00

    Your option is to settle with SmallImageList and LargeImageList so you need to separate them by size.

    1 person found this answer helpful.