Name
MeasureItemEventArgs
Synopsis
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()
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access