ColumnHeader.ImageIndex Property

 

Gets or sets the index of the image displayed in the ColumnHeader.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

[TypeConverterAttribute(typeof(ImageIndexConverter))]
public int ImageIndex { get; set; }

Property Value

Type: System.Int32

The index of the image displayed in the ColumnHeader.

Exception Condition
ArgumentOutOfRangeException

ImageIndex is less than -1.

The ImageIndex property refers to the index of an image specified by the SmallImageList property of the ListView that contains the ColumnHeader. The ImageIndex property returns -1 if there is no SmallImageList set on the containing ListView. The image displayed in a column is typically used to indicate the state of items in the column.

ImageKey and ImageIndex are mutually exclusive, meaning if one is set, the other is set to an invalid value and ignored.

The image associated with a ColumnHeader is typically used to indicate the state information. If you set the ImageIndex to a value greater than the index of the last item in the associated image list, ImageIndex will be set to the index of the last item in the image list.

.NET Framework
Available since 2.0
Return to top
Show: