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

# TCustomListView.CreateListItem

Signals the OnCreateItemClass event handler to get the class type used for new list items, and creates a new list item.

## Declaration

Source position: comctrls.pp line 1527

`protected function TCustomListView.CreateListItem: TListItem; virtual;`

## Function result

List item created in the method.

## Description

TListItemClass is the default class reference used to create the list item in the method. Use the OnCreateItemClass event handler to provide an alternate class type used for list Items in the control.

Items is assigned as the owner for the list item instance created in the method.

CreateListItem is called from the Add method in TListItems when an Owner has been assigned for the container.

## See also

TCustomListView.OnCreateItemClass |  | Event handler signalled to get the class reference used to create new list view items.
TCustomListView.Items |  | Collection of list items displayed on the list view control.
TListItem |  | Represents the items created in TCustomListView and descendants.
TListItemClass |  | Class reference used to create new instances of TListItem.
TListItems.Add |  | Adds a new list item to the container.
TListItems.Owner |  | List view control that is the owner of the container and its list items.