Question Insert Image + ListView Subitem

sonia.sardana

Active member
Joined
Jan 25, 2009
Messages
35
Programming Experience
Beginner
I want to know how to insert image into ListView Subitem.

I know how to insert image into ListView first Subitem means.

To insert an image into first item

VB.NET:
dim lvitem as ListViewItem
set lvitem=ListView1.Items.add("Sonia",me.ImageList1.Images.count-1)

Can somebody tell me how to insert an image without text into subitem.
 
As you can see in help for ListViewItemCollection the Add Method can take various types of input, for example a ListViewItem. To create a ListViewItem use the New keyword. Then you can set properties of the item you created, for example the ImageIndex property. For a full list of members for the ListViewItem class have a look in help. Here is example code that implements the ideas I just discussed:
VB.NET:
Dim item As ListViewItem = New ListViewItem
item.ImageIndex = 0
ListView1.Items.add(item)
I moved this thread to ListViews forum, it is more appropriate for your ListView usage thread topic than the VB.Net General forum.
 
You can't do that, ListViewItem.ListViewSubItem doesn't have any properties for that, only the ListViewItem can display image.
 
With a DataGridView control you have a image column at any index.
 
Back
Top