Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ListBox.GetItemHeight Method

Returns the height of an item in the ListBox.

[Visual Basic]
Public Function GetItemHeight( _
   ByVal index As Integer _
) As Integer
[C#]
public int GetItemHeight(
 int index
);
[C++]
public: int GetItemHeight(
 int index
);
[JScript]
public function GetItemHeight(
   index : int
) : int;

Parameters

index
The zero-based index of the item to return the height for.

Return Value

The height, in pixels, of the specified item.

Exceptions

Exception Type Condition
ArgumentOutOfRangeException The specified index was outside the range valid values.

Remarks

If the DrawMode property is not set to DrawMode.OwnerDrawVariable, the value of the index parameter is ignored because all items in a standard ListBox are the same size. You can use this property when you are using an owner-drawn ListBox to determine the size of any item within the ListBox.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

ListBox Class | ListBox Members | System.Windows.Forms Namespace

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft