ListView Control

The ListView control displays items using one of four different views. You can arrange items into columns with or without column headings as well as display accompanying icons and text.

Syntax

ListView

The properties, methods and events of the ListView control are described in the following table.

Properties Methods Events
ColumnHeaders FindItem AfterLabelEdit
HideColumnHeaders GetFirstVisible BeforeLabelEdit
Icons, SmallIcons ColumnClick
LabelEdit
LabelWrap
Listitems
MultiSelect (ListView)
SelectedItem
Sorted (ListView)
SortKey
SortOrder
View

Remarks

With a ListView control, you can organize list entries, called ListItem objects, into one of four different views:

The View property determines which view the control uses to display the items in the list. You can also control whether the labels associated with items in the list wrap to more than one line using the LabelWrap property. In addition, you can manage how items in the list are sorted and how selected items appear.

The ListView control contains ListItem and ColumnHeader objects. A ListItem object defines the various characteristics of items in the ListView control, such as:

You can choose to display column headings in the ListView control using the HideColumnHeaders property. They can be added at both design and run time. At design time, you can use the Column Headers tab of the ListView Control Properties dialog box. At run time, use the Add method to add a ColumnHeader object to the ColumnHeaders collection.