MeasureItemEventArgs

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()



. Net Windows Forms in a Nutshell
.NET Windows Forms in a Nutshell
ISBN: 0596003382
EAN: 2147483647
Year: 2002
Pages: 794

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net