次の方法で共有


ComboBox.ItemHeight プロパティ

コンボ ボックス内の項目の高さを取得または設定します。

Public Property ItemHeight As Integer
[C#]
public int ItemHeight {get; set;}
[C++]
public: __property int get_ItemHeight();public: __property void set_ItemHeight(int);
[JScript]
public function get ItemHeight() : int;public function set ItemHeight(int);

プロパティ値

コンボ ボックス内の項目の高さ (ピクセル単位)。

例外

例外の種類 条件
ArgumentException 項目の高さの値が 0 未満です。

解説

DrawMode プロパティが DrawMode.OwnerDrawFixed に設定されている場合は、すべての項目の高さが同じになります。 DrawMode プロパティが DrawMode.OwnerDrawVariable に設定されている場合、 ItemHeight プロパティは、 ComboBox に追加された各項目の高さを指定します。オーナー描画リスト内の各項目には異なる高さを設定できるため、 GetItemHeight メソッドを使用して ComboBox 内の特定の項目の高さを取得できます。高さが可変の項目が設定されている ComboBoxItemHeight プロパティを使用すると、このプロパティはコントロールの最初の項目の高さを返します。

オーナー描画リスト内の項目の高さの指定方法の詳細については、 MeasureItem イベントのトピックを参照してください。

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ

参照

ComboBox クラス | ComboBox メンバ | System.Windows.Forms 名前空間