Export (0) Print
Expand All

ImageList.ImageCollection.Item Property (Int32)

Gets or sets an Image at the specified index within the collection.

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

[BrowsableAttribute(false)]
public Image this[
	int index
] { get; set; }

Parameters

index
Type: System.Int32

The index of the image to get or set.

Property Value

Type: System.Drawing.Image
The image in the list specified by index.

ExceptionCondition
ArgumentOutOfRangeException

The index is less than 0 or greater than or equal to Count.

ArgumentException

image is not a Bitmap.

ArgumentNullException

The image to be assigned is null or not a Bitmap.

InvalidOperationException

The image cannot be added to the list.

The returned bitmap is a copy of the original image and should be disposed of using the Image.Dispose method.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft