ImageList.ImageCollection.Item Property (Int32)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

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.

Exception Condition
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
Available since 1.1
Return to top
Show: