次の方法で共有


ComboBox.GetItemHeight メソッド

ComboBox 内の項目の高さを返します。

Public Function GetItemHeight( _
   ByVal index As Integer _) As Integer
[C#]
public int GetItemHeight(intindex);
[C++]
public: int GetItemHeight(intindex);
[JScript]
public function GetItemHeight(
   index : int) : int;

パラメータ

  • index
    高さが返される項目のインデックス。

戻り値

指定したインデックスにある項目の高さ (ピクセル単位)。

例外

例外の種類 条件
ArgumentOutOfRangeException index が 0 未満です。

または

index がリスト内の項目数を超える値になっています。

解説

DrawMode プロパティが DrawMode.OwnerDrawVariable に設定されていない場合、標準の ComboBox 内の項目はすべて同じサイズであるため、 index パラメータの値は無視されます。オーナー描画 ComboBox を使用している場合は、このプロパティを使用して ComboBox 内のすべての項目のサイズを決定できます。

オーナー描画リスト内の項目の高さの指定方法の詳細については、 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 名前空間