NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

MenuItem MeasureItem Event

Occurs when when the menu needs to know the size of a menu item before drawing it.

The following declaration shows the syntax for a method that handles the MeasureItem event.

[Visual Basic]
Private Sub MenuItemName_MeasureItem( _
   ByVal sender As Object, _
   ByVal e As MeasureItemEventArgs _
)
[C#]
private void MenuItemName_MeasureItem(
   object sender,
   MeasureItemEventArgs e
);
[C++]
private: void MenuItemName_MeasureItem(
   Object* sender,
   MeasureItemEventArgs* e
);
[JScript]
private MenuItemName_MeasureItem(
   sender : Object,
   e : MeasureItemEventArgs
);

Parameters

sender
The source of the event.
e
A MeasureItemEventArgs that contains the event data. The following MeasureItemEventArgs properties provide information specific to this event.
Property Description
Graphics
A Graphics object to measure relative to.
Index
The index of item for which the height/width is needed.
ItemHeight
Where the recipient of the event should put the height of the item specified by the index.
ItemWidth
Where the recipient of the event should put the width of the item specified by the index.

Remarks

In order for this event to be raised you must have the 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 draw to be specified.

See Also

MenuItem Class | MenuItem MembersTopic | System.WinForms Namespace