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 事件。

適用於