ListBox.GetItemHeight(Int32) 方法

定義

傳回 ListBox 中項目的高度。

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

要傳回其高度的項目之以零為起始的索引。

傳回

Int32

指定項目的高度 (單位為像素)。

例外狀況

index 參數的指定值小於零或大於項目計數。

備註

DrawMode如果 屬性未設定為 DrawMode.OwnerDrawVariable ,則會忽略索引參數的值,因為標準 ListBox 中的所有專案的大小都相同。 當您使用以擁有者繪製 ListBox 來判斷 內 ListBox 任何專案的大小時,可以使用這個屬性。

適用於