ToolStripItem.ImageIndex ToolStripItem.ImageIndex ToolStripItem.ImageIndex ToolStripItem.ImageIndex Property

Definition

Gets or sets the index value of the image that is displayed on the item.

public:
 property int ImageIndex { int get(); void set(int value); };
[System.ComponentModel.Browsable(false)]
[System.ComponentModel.TypeConverter(typeof(System.Windows.Forms.NoneExcludedImageIndexConverter))]
[System.Windows.Forms.RelatedImageList("Owner.ImageList")]
public int ImageIndex { get; set; }
member this.ImageIndex : int with get, set
Public Property ImageIndex As Integer

Property Value

The zero-based index of the image in the ImageList that is displayed for the item. The default is -1, signifying that the image list is empty.

Exceptions

Remarks

The ImageIndex property specifies the position of the image in the image list. The ImageKey property specifies the image itself.

The Image, ImageAlign, ImageIndex, ImageKey, and ImageScaling properties pertain to various aspects of image handling. Use images in ToolStrip controls by setting these properties directly or by setting the run-time-only ImageList property.

Image scaling is determined by the interaction of properties in both ToolStrip and ToolStripItem, as follows:

Applies to