Vcl.Menus.NewMenu
Delphi
function NewMenu(Owner: TComponent; const AName: string; const Items: array of TMenuItem): TMainMenu;
C++
extern DELPHI_PACKAGE TMainMenu* __fastcall NewMenu(System::Classes::TComponent* Owner, const System::UnicodeString AName, TMenuItem* const *Items, const int Items_High);
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | public | Vcl.Menus.pas Vcl.Menus.hpp |
Vcl.Menus | Vcl.Menus |
Description
Creates and initializes a main menu.
Call NewMenu to create and initialize a main menu programmatically. NewMenu returns the TMainMenu component that represents the menu.
The Owner
parameter specifies the component that is responsible for freeing the menu (typically the form).
The AName
parameter specifies the name of the menu, which is used to refer to it in code.
The Items
parameter is an array of menu items that make up the top level menu items. To create the menu items for the Items
parameter, use the NewItem function.
Note: The
Items_Size
parameter specifies the index of the last menu item in Items (one less than the number of menu items).
See Also