[Overview][Constants][Types][Classes][Procedures and functions][Index] | Reference for unit 'ComCtrls' (#lcl)

# TListItem.Caption

Caption - the name given to this item on the list.

## Declaration

Source position: comctrls.pp line 1072

`public property TListItem.Caption : string read GetCaption write SetCaption;`

## Description

Caption is a String property with the text displayed for the list item. It is also used as the Name displayed for the class instance in the Lazarus Object Inspector.

The property value is assigned when TCustomListView.AddItem creates the TListItem instance in its Items property. Changing the value for the property causes the list view control to be notified when WSUpdateAllowed returns True.

Caption is used in the TCustomListView.DrawItem method to draw the text for the list item. It provides the initial value displayed when the editor is activated for an item on the list view control, and is updated when editing is completed.

## See also

TCustomListView.DrawItem |  | Draws the specified list item with a given state.
TCustomListView.Edit |  | Signals OnEdited to validate the editor text, and updates the caption for the specified list item.
TCustomListView.AddItem |  | Adds a list item with the specified caption and optional object.
TCustomListView.Items |  | Collection of list items displayed on the list view control.
TListItems.AddItem |  | Adds the specified list item to the storage for the container.
TListItems.Add |  | Adds a new list item to the container.