ComboBox.GetItemHeight(Int32) 方法

定义

返回项在 . 中的 ComboBox高度。

public:
 int GetItemHeight(int index);
public int GetItemHeight(int index);
member this.GetItemHeight : int -> int
Public Function GetItemHeight (index As Integer) As Integer

参数

index
Int32

要返回其高度的项的索引。

返回

指定索引处项的高度(以像素为单位)。

例外

小于 index 零。

-或-

大于 index 列表中的项计数。

注解

如果未 DrawMode 设置为 OwnerDrawVariable,则忽略参数的值 index ,因为标准 ComboBox 中的所有项的大小都相同。 使用所有者绘制 ComboBox 来确定其中 ComboBox任何项的大小时,可以使用此属性。

有关指定所有者绘制列表中的项的高度的详细信息,请参阅 MeasureItem 事件。

适用于