Export (0) Print
Expand All

ComboBox.GetItemHeight Method

Returns the height of an item in the ComboBox.

[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 index of the item to return the height of.

Return Value

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

Exceptions

Exception Type Condition
ArgumentOutOfRangeException The index is less than zero.

-or-

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

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 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 on specifying the height for items in an owner-drawn list, see MeasureItem event.

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

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

Show:
© 2015 Microsoft