Unit 'Menus' Package
[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] [#lcl]

TMenuItem.Add

Adds item(s) to the menu item.

Declaration

Source position: menus.pp line 273

public procedure TMenuItem.Add(

  Item: TMenuItem

);

procedure TMenuItem.Add(

  const AItems: array of TMenuItem

);

Arguments

Item

  

Menu item added to the child Items.

Arguments

AItems

  

Array of menu items added to the child Items.

Description

Add is an overloaded method used to add one or more items to the menu. Variants are provided that allow a single TMenuItem instance to be added, or an array of TMenuItem instances.

The single menu item variant calls Insert to store the value in Item at the position in the Count property. Insert will increment the value in Count.

The array variant iterates over each of the elements in the array, and calls Add to store the menu instances in Items.

Be aware that adding an child menu item that is a Separator may crash the application on non-Windows platforms. Use the AddSeparator method instead.