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

# TCustomListBox.DeleteSelected

Removes one or more selected entries from the Items property.

## Declaration

Source position: stdctrls.pp line 630

`public procedure TCustomListBox.DeleteSelected; virtual;`

## Description

DeleteSelected is a procedure used to delete one or more entries in the Items property based on their selection state.

DeleteSelected uses the value in MultiSelect to determine if multiple values in Items are examined and removed. When MultiSelect is True, the values in Items are visited in reverse order and the Delete method in Items is called if the item is Selected. When MultiSelect is not enabled, the value in the ItemIndex property is used to examine a single entry and remove it when it is Selected.

No values are removed from Items when none of the entries in Selected are True.

## See also

TCustomListBox.Items |  | The list of all items defined in the control.
TCustomListBox.Selected |  | The Selected state for an item in the control.
TCustomListBox.MultiSelect |  | Allows selection of more than one item from the list.