This documentation is archived and is not being maintained.

ComboBox.GetItemHeight Method

Returns the height of an item in the ComboBox.

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


The index of the item to return the height of.

Return Value

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


Exception Type Condition
ArgumentOutOfRangeException The index is less than zero.


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


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.


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