Export (0) Print
Expand All

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
Not applicable.

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 Server 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 Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft