Working with the ListView Control

The ListView control is an ActiveX control that provides a visual interface to display items in table form or in lists with an associated icon. Windows Explorer is an example of an application that uses a ListView control.

The ListView control uses two collections of objects, ListItems and ColumnHeaders, to store and display data. The ListItems collection contains ListItem objects. Each ListItem represents an individual item that can be displayed in the control. Each ColumnHeader represents a column of ListItem objects.

A ListItem has a label represented by the Text property and an icon represented by the Icon or SmallIcon properties. In addition, a ListItem has a Selected property to indicate if a user selects the item. It also has a SubItems property you can use to add other information to the control.