How can I set an icon for a ListViewSubItem?

前端 未结 7 681
既然无缘
既然无缘 2020-12-05 19:36

In a ListView you can have icons on each item.
When viewing in Details-mode, the icon is shown in the left-most column.

Can I show an icon in some other column?<

7条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-05 20:19

    The icon is shown in the "first" column, and this is also the basis for the keyboard prefix search. One possible solution could be to reorder the columns by setting the DisplayIndex of the first column to something else.

    listView1.Columns[0].DisplayIndex = 1;
    

    This of course only works if you need an icon in only one column.

提交回复
热议问题