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

# TMenuItem.OnMeasureItem

Event handler signalled to get the Width and Height for the menu item.

## Declaration

Source position: menus.pp line 353

`published property TMenuItem.OnMeasureItem : TMenuMeasureItemEvent read FOnMeasureItem write FOnMeasureItem;`

## Description

OnMeasureItem is a TMenuMeasureItemEvent property with the event handler signalled to calculate the width and height for the menu item. The ACanvas argument contains the TCanvas instance used to get the width and height for the font used on the menu item, and is returned by the widgetset class instance. AWidth and AHeight are variable arguments updated with the dimensions for the menu item as returned by the widget.

OnMeasureItem is signalled (when assigned) from the DoMeasureItem method, and occurs when the MenuItemSize routine is called for the platform / widgetset.

## See also

TMenuItem.DoMeasureItem |  | Performs actions needed to get the width and height for the menu item.
TMenuMeasureItemEvent |  | Specifies an event handler signalled to get the width and height for a menu item.