MeasureItemEventArgs Class

 

Provides data for the MeasureItem event of the ListBox, ComboBox, CheckedListBox, and MenuItem controls.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

System.Object
  System.EventArgs
    System.Windows.Forms.MeasureItemEventArgs

type MeasureItemEventArgs = 
    class
        inherit EventArgs
    end

NameDescription
System_CAPS_pubmethodMeasureItemEventArgs(Graphics, Int32)

Initializes a new instance of the MeasureItemEventArgs class.

System_CAPS_pubmethodMeasureItemEventArgs(Graphics, Int32, Int32)

Initializes a new instance of the MeasureItemEventArgs class providing a parameter for the item height.

NameDescription
System_CAPS_pubpropertyGraphics

Gets the Graphics object to measure against.

System_CAPS_pubpropertyIndex

Gets the index of the item for which the height and width is needed.

System_CAPS_pubpropertyItemHeight

Gets or sets the height of the item specified by the Index.

System_CAPS_pubpropertyItemWidth

Gets or sets the width of the item specified by the Index.

NameDescription
System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

This event is sent when the OwnerDraw property of ListBox, ComboBox, CheckedListBox, or MenuItem is set to true. It is used to tell the drawing function how to size an item.

For information about the event model, see Handling and Raising Events.

The following code example demonstrates how to use the Graphics property to perform custom drawing of the items in a ListBox.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1

Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: