ComboBox.ItemHeight 属性

获取或设置组合框中的某项的高度。

**命名空间:**System.Windows.Forms
**程序集:**System.Windows.Forms(在 system.windows.forms.dll 中)

语法

声明
<LocalizableAttribute(True)> _
Public Property ItemHeight As Integer
用法
Dim instance As ComboBox
Dim value As Integer

value = instance.ItemHeight

instance.ItemHeight = value
[LocalizableAttribute(true)] 
public int ItemHeight { get; set; }
[LocalizableAttribute(true)] 
public:
property int ItemHeight {
    int get ();
    void set (int value);
}
/** @property */
public int get_ItemHeight ()

/** @property */
public void set_ItemHeight (int value)
public function get ItemHeight () : int

public function set ItemHeight (value : int)

属性值

组合框中某项的高度(以像素为单位)。

异常

异常类型 条件

ArgumentException

项高度值小于零。

备注

DrawMode 属性设置为 OwnerDrawFixed 时,所有项具有相同的高度。当 DrawMode 属性设置为 OwnerDrawVariable 时,ItemHeight 属性指定添加到 ComboBox 中的每个项的高度。因为所有者描述的列表中的每个项可具有不同的高度,所以可使用 GetItemHeight 方法获取 ComboBox 中特定项的高度。如果对具有可变高度的项的 ComboBox 使用 ItemHeight 属性,则此属性返回控件中第一个项的高度。

有关为所有者描述的列表中的项指定高度的更多信息,请参见 MeasureItem 事件。

平台

Windows 98、Windows 2000 SP4、Windows CE、Windows Millennium Edition、Windows Mobile for Pocket PC、Windows Mobile for Smartphone、Windows Server 2003、Windows XP Media Center Edition、Windows XP Professional x64 Edition、Windows XP SP2、Windows XP Starter Edition

.NET Framework 并不是对每个平台的所有版本都提供支持。有关受支持版本的列表,请参见系统要求

版本信息

.NET Framework

受以下版本支持:2.0、1.1、1.0

请参见

参考

ComboBox 类
ComboBox 成员
System.Windows.Forms 命名空间