ComboBox.ItemHeight 屬性

定義

取得或設定下拉式方塊中的項目高度。

public:
 property int ItemHeight { int get(); void set(int value); };
public int ItemHeight { get; set; }
member this.ItemHeight : int with get, set
Public Property ItemHeight As Integer

屬性值

下拉式方塊的項目高度 (單位為像素)。

例外狀況

項目高度值小於零。

備註

DrawMode當 屬性設定為 OwnerDrawFixed 時,所有專案的高度都相同。 DrawMode當 屬性設定為 OwnerDrawVariable 時, ItemHeight 屬性會指定加入至 ComboBox 的每個專案高度。 因為擁有者繪製清單中的每個專案可以有不同的高度,所以您可以使用 GetItemHeight 方法來取得 中 ComboBox 特定專案的高度。 如果您在 ItemHeight 具有可變高度專案的 上使用 ComboBox 屬性,這個屬性會傳回 控制項中第一個專案的高度。

如需在擁有者繪製清單中指定專案高度的詳細資訊,請參閱 MeasureItem 事件。

適用於