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

# TMenuDrawItemEvent

Specifies an event handler signalled to draw a menu item on the given canvas.

## Declaration

Source position: menus.pp line 117

`type TMenuDrawItemEvent = procedure(`
`Sender: TObject;`
`ACanvas: TCanvas;`
`ARect: TRect;`
`AState: TOwnerDrawState`
`) of object;`

## Arguments

`Sender` |  | Object (TMenuItem) for the event notification.
`ACanvas` |  | Canvas used to render the menu item.
`ARect` |  | Display rectangle for the menu item.
`AState` |  | Owner-drawn state for the menu item.

## Description

TMenuDrawItemEvent defines the signature for the handler routine. An application can implement and assign a handler to perform drawing operations for the menu item in the Self argument.

ACanvas is the TCanvas instance where the menu item is drawn.

ARect contains the display rectangle on the canvas where the menu item is drawn.

AState is the owner-draw state for the menu item, and indicates whether it is drawn using attributes to reflect its state.

TMenuDrawItemEvent is the type for the OnDrawItem property in TMenuItem.

## See also

TMenuItem.OnDrawItem |  | Event handler signalled to draw the menu item.
TMenuItem.DoDrawItem |  | Performs actions needed to draw the menu item to the specified Canvas.