This documentation is archived and is not being maintained.

ComboBox.GetItemHeight Method

Returns the height of an item in the ComboBox.

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)

public int GetItemHeight (
	int index
)
public int GetItemHeight (
	int index
)
public function GetItemHeight (
	index : int
) : int

Parameters

index

The index of the item to return the height of.

Return Value

The height, in pixels, of the item at the specified index.

Exception typeCondition

ArgumentOutOfRangeException

The index is less than zero.

-or-

The index is greater than count of items in the list.

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

For more information about specifying the height for items in an owner-drawn list, see MeasureItem event.

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0
Show: