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

# TMainMenu

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

TMainMenu - the Main Menu that appears at the top of most windows.

## Declaration

Source position: menus.pp line 440

`type TMainMenu = class(TMenu)`
`protected`
`procedure ItemChanged;` |  | Performs actions needed when a menu item has been changed.
`class procedure WSRegisterClass; override;` |  | Registers this component class with the current WidgetSet.
`procedure MenuChanged(); override;` |  | Implements the OnChange event handler used for menu items in the class instance.
`public`
`constructor Create(); override;` |  | Constructor for the class instance.
`procedure Merge();` |  | Merges menu items from the specified main menu instance.
`procedure Unmerge();` |  | Removes merged menu items for the specified menu.
`property Height: Integer; [r]` |  | Height for the menu.
`property WindowHandle: HWND; [rw]` |  | Handle for the window where the menu is displayed.
`published`
`property OnChange: TMenuChangeEvent;` |  | Event handler signalled when a menu item has been changed.
`end;`

## Inheritance

`TMainMenu` |  | TMainMenu - the Main Menu that appears at the top of most windows.
`TMenu` |  | TMenu - a menu appearing in a form. Base class for TMainMenu or TPopupMenu.
`TLCLComponent` |  | The base class for LCL components which have an associated widget.
`TComponent`
?
`TObject`

## Description

TMainMenu - the Main Menu that appears at the top of most windows; form designers can customize by choosing various menu items.

Main Menu is a non-visible component: that is, if the icon is selected from the Component Palette and placed on the Form, it will not appear at Run-time. Instead, a Menu bar with a structure defined by the Menu Editor will appear.

To see the Menu Editor, right-click on the Main Menu icon on your Form.

## See also

How To Use Menus |  | HowToUseMenus - hints for creating Menus for your Forms.
TMenuItem |  | Represents a menu item displayed in a menu.
TMenu |  | TMenu - a menu appearing in a form. Base class for TMainMenu or TPopupMenu.
TMenuActionLink |  | TMenuActionLink: defines the link between a selected menu item and its corresponding action.