Occurs when the menu needs to know the size of a menu item before drawing it.
[Visual Basic] Public Event MeasureItem As MeasureItemEventHandler [C#] public event MeasureItemEventHandler MeasureItem; [C++] public: __event MeasureItemEventHandler* MeasureItem;
[JScript] In JScript, you can handle the events defined by a class, but you cannot define your own.
The event handler receives an argument of type MeasureItemEventArgs containing data related to this event. The following MeasureItemEventArgs properties provide information specific to this event.
|Graphics||Gets the Graphics object to measure against.|
|Index||Gets or sets the index of the item for which the height and width is needed.|
|ItemHeight||Gets or sets the height of the item specified by the Index.|
|ItemWidth||Gets or sets the width of the item specified by the Index.|
In order for this event to be raised, you must have the OwnerDraw property of the menu item set to true. This event is raised before owner drawn menus are drawn to allow for the size of the menu item to be drawn to be specified. For more information about handling events, see Consuming Events.
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family