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

# TMenuItem.Delete

Deletes the child menu item at the specified position in Items.

## Declaration

Source position: menus.pp line 283

`public procedure TMenuItem.Delete(`
`Index: Integer`
`);`

## Arguments

`Index` |  | Ordinal position for the menu item removed in the method.

## Description

Delete is a method used to delete the menu item in Items at the position specified in Index. Index must be in the range 0..Count-1. An EMenuError exception is raised when Index is not in the required range, when Items has not been assigned for the class instance, or when the menu item has already been freed.

Delete calls the DestroyHandle method for the TMenuItem instance to free the Handle for the menu item, and sets its Parent property to Nil. The Delete method in Items is called to free the menu item. The MenuChanged method is called to signal the OnChange event handler (when assigned) and to optionally rebuild the child menu items.