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

# TCustomListView.Delete

Deletes the specified list item.

## Declaration

Source position: comctrls.pp line 1534

`protected procedure TCustomListView.Delete(`
`AItem: TListItem`
`); virtual;`

## Arguments

`AItem` |  | List item deleted in the method.

## Description

Delete is a method used to delete the list item specified in AItem.

In Delphi, Delete is called when Items.Delete is executed. The OnDeletion event handler is signalled each time the method is called, even when list items are freed from the Items container.

The Lazarus implementation differs. It uses a flag value in AItem to determine if the method has been called when the list item is freed, or when the Delete method in the list item has been called explicitly.

Delete is called from the DoDeletion method if an overridden Delete method has been implemented. The OnDeletion event handler is signalled when Delete has been explicitly called, and when the Delete method has not been overridden.

While not 100% Delphi compatible, it is more compatible than previous LCL versions.

## See also

TCustomListView.DoDeletion |  | Performs actions needed to delete the specified list item.
TCustomListView.OnDeletion |  | Event handler signalled when a list item is deleted from the Items container.
TCustomListView.Items |  | Collection of list items displayed on the list view control.
TCustomListView.ItemDeleted |  | Called when the specified list item is removed from the list.
TListItem.Delete |  | Removes the list item from the container.
TListItems.Delete |  | Removes the list item specified in AIndex from the container.