How to add an icon to the listView in Windows Forms c#? I have found a NuGet called "ObjectListView" but I don't understand how to add items and sub-items to it. By using standard listview I am able to add images to the first column only.
ListViewItem item = new ListViewItem();
item.ImageIndex = 0;
this.listView1.Items.Add(item);
I'm trying to add buttons to remove/restart/etc. for USB devices like this MyProgram
I need those buttons/Images in "remove", "Restart, "Uninstall" columns as subitems.
By using this I can "switch" columns, but still cannot add images/buttons for multiple columns.
listView1.Columns[0].DisplayIndex = 1;
// listView1.Items.Add("tekst3", 3);
// listView1.Items.Add("tekst2", 2);
//listView1.Items.Add("tekst1", 1);
for (int j = 0; j < 10; j++)
{
ListViewItem item = new ListViewItem();
item.ImageIndex = 0;
this.listView1.Items.Add(item);
}
An image list is added with loaded files(3 of them) attached to the list view small/large image list.