DekGenius.com
[ Team LiB ] Previous Section Next Section

MeasureItemEventArgs

System.Windows.Forms (system.windows.forms.dll)class

This class wraps the data for the MeasureItem event, raised by various controls including ListBox, ComboBox, and MenuItem, which support owner draw modes.

MeasureItem is raised when the DrawMode is set to OwnerDrawVariable, and is used to determine the ItemWidth and ItemHeight of the item at a particular Index in the controls collection, when it is drawn on a particular System.Drawing.Graphics surface.

It is not raised when the DrawMode is OwnerDrawFixed. Instead, you should use the ItemHeight property on the owner drawn control.

public class MeasureItemEventArgs : EventArgs {
// Public Constructors
   public MeasureItemEventArgs(System.Drawing.Graphics graphics, int index);
   public MeasureItemEventArgs(System.Drawing.Graphics graphics, int index, int itemHeight);
// Public Instance Properties
   public Graphics Graphics{get; }
   public int Index{get; }
   public int ItemHeight{set; get; }
   public int ItemWidth{set; get; }
}

Hierarchy

System.Object System.EventArgs MeasureItemEventArgs

Passed To

ComboBox.OnMeasureItem(), ListBox.OnMeasureItem(), MeasureItemEventHandler.{BeginInvoke(), Invoke()}, MenuItem.OnMeasureItem()

    [ Team LiB ] Previous Section Next Section