ToolStripItem.ImageIndex 屬性


取得或設定此項目上顯示的影像索引值。Gets or sets the index value of the image that is displayed on the item.

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


ImageList 中為項目顯示之影像的以零起始的索引。The zero-based index of the image in the ImageList that is displayed for the item. 預設值為 -1,表示影像清單是空的。The default is -1, signifying that the image list is empty.



指定的值小於 -1。The value specified is less than -1.


ImageIndex 屬性會指定影像在影像清單中的位置。The ImageIndex property specifies the position of the image in the image list. ImageKey 屬性會指定映射本身。The ImageKey property specifies the image itself.

[Image]、[ImageAlign]、[ImageIndex]、[ImageKey] 和 [ImageScaling] 屬性都與影像處理的各個層面有關。The Image, ImageAlign, ImageIndex, ImageKey, and ImageScaling properties pertain to various aspects of image handling. 直接設定這些屬性,或設定僅限執行時間的 ImageList 屬性,即可使用 ToolStrip 控制項中的影像。Use images in ToolStrip controls by setting these properties directly or by setting the run-time-only ImageList property.

影像調整是由 ToolStripToolStripItem中的屬性互動所決定,如下所示:Image scaling is determined by the interaction of properties in both ToolStrip and ToolStripItem, as follows: