How to add an image instead of text for a listview subitem? Like http://i44.tinypic.com/2mzz6s6.png ?
here is normally how I add a string:
ListViewItem item = new ListViewItem("A");
item.SubItems.Add("B");
item.SubItems.Add("C");
listView1.Items.AddRange(new ListViewItem[] { item });
I am using .NET 2.0 with WinForms. Also, please don't link me to articles with superior .NET listview controls. I want to stick to the standard one in MSVC.
If you need the icon to be in the first column, then it could be easily done by creating an
ImageListwith images you want to display, assigning it to theSmallImageListproperty of theListViewand setting appropriateImageIndexfor the item. Like this: