Vcl.Menus.TMenuItem.OnDrawItem

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property OnDrawItem: TMenuDrawItemEvent read FOnDrawItem write FOnDrawItem;

C++

__property TMenuDrawItemEvent OnDrawItem = {read=FOnDrawItem, write=FOnDrawItem};

Properties

Type Visibility Source Unit Parent
event published
Vcl.Menus.pas
Vcl.Menus.hpp
Vcl.Menus TMenuItem

Description

Occurs when an owner-draw menu needs to be drawn.

Write an OnDrawItem event handler to render the image of a menu item in an owner-draw menu. In the event handler, use the Bitmap property or the ImageIndex property to access a bitmap that represents the menu item.

Note: OnDrawItem will only occur if the parent menu's OwnerDraw property is true or the parent menu's Images property has been set.

Tip: For more precise information about the menu item's state, use the OnAdvancedDrawItem event instead.

See Also