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

# TCustomIcon.Delete

Deletes the image at the specified position in the list of images for the icon.

## Declaration

Source position: graphics.pp line 1657

`public procedure TCustomIcon.Delete(`
`Aindex: Integer`
`);`

## Arguments

`Aindex` |  | Ordinal position for the icon image deleted in the method.

## Description

Delete is a procedure used to delete the icon image at the ordinal position specified in AIndex from the list of images for the icon.

Delete calls UnshareImage to stop sharing the image list for the icon. A copy of the images is kept and restored when the Delete method in TSharedIcon has removed the image at the specified position.

When AIndex is also the Current image for the icon, Current is set to -1 and the UpdateCurrentView method is called. Otherwise, the value in Current is decremented.

Use Remove to delete an icon image with specific PixelFormat, Height, and Width values.

Use Add to add an icon image with specific PixelFormat, Height, and Width values.

Use Count to determine the number of images in the list of images for the icon.