VLMenuPlus Reference

EventSetMenuItemSize

See Also See Also Applies To Applies To

This event occurs when size of a menu item needs to be calculated.

 

Syntax

Private Sub object _SetMenuItemSize( ByVal mnuItem As CMenuItem, _
ByRef nWidth As Long, _
ByRef nHeight As Long)

 

The SetMenuItemSize event syntax has these parts:

Part Description
object An object expression that evaluates to an object of VLMenuPlus type.
mnuItem A CMenuItem object corresponding to the menuitem that needs to be drawn. For details refer to CMenuItem documentation.
nWidth A long value indicating the width of the menuitem as calculated by the control.

If you are handling the painting of this menu item, you can set this to the width as per your calculations.

nHeight A long value indicating the height of the menuitem as calculated by the control.

If you are handling the painting of this menu item, you can set this to the height as per your calculations.

Remarks

You normally do not need to handle this event. Parameters nWidth and nHeight parameters will have the width and height of the menu item respectively, as calculated by the control. These diemensiones are suitable for drawing menuitem in the default style.

If you are planning to draw the menu by handling DrawMenuItem event, you might need to set menu item size as per your requirement in this event.