System.Windows.Forms.ListBox.ItemHeight Property

Gets or sets the height of an item in the System.Windows.Forms.ListBox.

Syntax

[System.ComponentModel.RefreshProperties(System.ComponentModel.RefreshProperties.Repaint)]
[System.ComponentModel.Localizable(true)]
[System.ComponentModel.DefaultValue(13)]
public virtual int ItemHeight { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

When the ListBox.DrawMode property is set to DrawMode.OwnerDrawFixed, all items have the same height. When the ListBox.DrawMode property is set to DrawMode.OwnerDrawVariable, the ListBox.ItemHeight property specifies the height of each item added to the System.Windows.Forms.ListBox. Because each item in an owner-drawn list can have a different height, you can use the ListBox.GetItemHeight(int) method to get the height of a specific item in the System.Windows.Forms.ListBox. If you use the ListBox.ItemHeight property on a System.Windows.Forms.ListBox with items of variable height, this property returns the height of the first item in the control.

The maximum height of a System.Windows.Forms.ListBox item is 255 pixels.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0