Edit Listview Subitem In Vb6 Source
A double click on the ListView.SubItem will visualize a TextBox overlaying the SubItem with same size. The entered signs will be written to the SubItem after TextBoxLostFocus event was raised (by clicking on the ListView control or hit RETURN key). The following Visual Basic code is to be inserted into a form (e.g.
-->Definition
Gets a collection containing all subitems of the item.
Property Value
A ListViewItem.ListViewSubItemCollection that contains the subitems.
Examples
The following code example creates a ListView control with three ListViewItem objects specified and three ListViewItem.ListViewSubItem objects specified for each item. The example also creates ColumnHeader objects to display the subitems in details view. Two ImageList objects are also created in the code example to provide images for the ListViewItem objects. These ImageList objects are added to the LargeImageList and SmallImageList properties. The example uses the following properties in creating the ListView control:
You need to add the code to a Form and call the method created in the example from the constructor or another method on the form. The example requires that images named MySmallImage1
, MySmallImage2
, MyLargeImage1
, and MyLargeImage2
are located in the root directory of drive C.
Remarks
Using the ListViewItem.ListViewSubItemCollection, you can add subitems, remove subitems, and obtain a count of subitems. For more information on the tasks that can be performed with the subitems in the collection, see the ListViewItem.ListViewSubItemCollection class reference topics.
Note
The first subitem in the ListViewItem.ListViewSubItemCollection is always the item that owns the subitems. When performing operations on subitems in the collection, be sure to reference index position 1 instead of 0 to make changes to the first subitem.
Applies to
See also
- ListViewItem.ListViewSubItemCollectionListViewItem.ListViewSubItemCollectionListViewItem.ListViewSubItemCollectionListViewItem.ListViewSubItemCollection