Delphi Programming
This page is intended as a supplement to the official documentation on Delphi programming. CodeGear is in the process of putting the Delphi documentation on the Web. Once they have done so, this page will link to the relevant page in the official documentation.
This article is a stub.
Please help enhance the Delphi Programming Wiki by expanding it.
see the VCL Documentation Guidelines for an overview on doc pages




TMainMenu encapsulates the functionality of a windows main menu that typically appears below the title bar of a window (i.e. File, Edit, Help, etc.).

This component provides a property editor to add TMenuItem objects that can be manipulated with captions, glyphs, check boxes and of course provides events for defining actions to take when the user clicks on the menu item.

To provide a main menu on a window simply drop a TMainMenu component onto the form. Double click on the component to open the property editor to define TMenuItem objects. Set the caption and on click event via the object inspector (press F11 to display).

Technical Comments[]

The main menu on a form is a property of the TForm that it is placed on. You may only have one assigned at a time. It is assigned by default the first time you place a TMainMenu on a form.

You may assign an TImageList component to the menu via the object inspector and place a glyph (bitmap image) next to an item by setting the TMenuItem's ImageIndex property to the corresponding image in the TImageList.


(Please provide links to articles/source code that show how to use this item.)

See Also[]

(Please provide links to items specifically related to this item.)

User Comments/Tips[]

(Please leave your name with your comment.)