Export (0) Print
Expand All

ImageList.ImageCollection Class

Encapsulates the collection of Image objects in an ImageList.

System.Object
  System.Windows.Forms.ImageList.ImageCollection

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

[<Sealed>]
type ImageCollection =  
    class 
        interface IList 
        interface ICollection 
        interface IEnumerable 
    end

The ImageList.ImageCollection type exposes the following members.

  NameDescription
Public propertyCountGets the number of images currently in the list.
Public propertyEmptyGets a value indicating whether the ImageList has any images.
Public propertyIsReadOnlyGets a value indicating whether the list is read-only.
Public propertyItem(Int32)Gets or sets an Image at the specified index within the collection.
Public propertyItem(String)Gets an Image with the specified key from the collection.
Public propertyKeysGets the collection of keys associated with the images in the ImageList.ImageCollection.
Top

  NameDescription
Public methodAdd(Icon)Adds the specified icon to the ImageList.
Public methodAdd(Image)Adds the specified image to the ImageList.
Public methodAdd(Image, Color)Adds the specified image to the ImageList, using the specified color to generate the mask.
Public methodAdd(String, Icon)Adds an icon with the specified key to the end of the collection.
Public methodAdd(String, Image)Adds an image with the specified key to the end of the collection.
Public methodAddRangeAdds an array of images to the collection.
Public methodAddStripAdds an image strip for the specified image to the ImageList.
Public methodClearRemoves all the images and masks from the ImageList.
Public methodContainsNot supported. The IList.Contains method indicates whether a specified object is contained in the list.
Public methodContainsKeyDetermines if the collection contains an image with the specified key.
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public methodGetEnumeratorReturns an enumerator that can be used to iterate through the item collection.
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodIndexOfNot supported. The IndexOf method returns the index of a specified object in the list.
Public methodIndexOfKeyDetermines the index of the first occurrence of an image with the specified key in the collection.
Public methodRemoveNot supported. The IList.Remove method removes a specified object from the list.
Public methodRemoveAtRemoves an image from the list.
Public methodRemoveByKeyRemoves the image with the specified key from the collection.
Public methodSetKeyNameSets the key for an image in the collection.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

  NameDescription
Public Extension MethodAsParallel()Overloaded. Enables parallelization of a query. (Defined by ParallelEnumerable.)
Public Extension MethodAsParallel()Overloaded. (Defined by ParallelEnumerable.)
Public Extension MethodAsQueryable()Overloaded. Converts an IEnumerable to an IQueryable. (Defined by Queryable.)
Public Extension MethodAsQueryable()Overloaded. (Defined by Queryable.)
Public Extension MethodCast(TResult)()Overloaded. Casts the elements of an IEnumerable to the specified type. (Defined by Enumerable.)
Public Extension MethodCast(TResult)()Overloaded. (Defined by Enumerable.)
Public Extension MethodOfType(TResult)()Overloaded. Filters the elements of an IEnumerable based on a specified type. (Defined by Enumerable.)
Public Extension MethodOfType(TResult)()Overloaded. (Defined by Enumerable.)
Top

  NameDescription
Explicit interface implemetationPrivate methodICollection.CopyToInfrastructure. Copies the items in this collection to a compatible one-dimensional array, starting at the specified index of the target array.
Explicit interface implemetationPrivate propertyICollection.IsSynchronizedInfrastructure. Gets a value indicating whether access to the collection is synchronized (thread safe).
Explicit interface implemetationPrivate propertyICollection.SyncRootInfrastructure. Gets an object that can be used to synchronize access to the collection.
Explicit interface implemetationPrivate methodIList.AddInfrastructure. Adds the specified image to the ImageList.
Explicit interface implemetationPrivate methodIList.ContainsInfrastructure. Implements the Contains method. Throws a NotSupportedException in all cases.
Explicit interface implemetationPrivate methodIList.IndexOfInfrastructure. Implements the IndexOf method. Throws a NotSupportedException in all cases.
Explicit interface implemetationPrivate methodIList.InsertInfrastructure. Implements the Insert method. Throws a NotSupportedException in all cases.
Explicit interface implemetationPrivate propertyIList.IsFixedSizeInfrastructure. Gets a value indicating whether the ImageList.ImageCollection has a fixed size.
Explicit interface implemetationPrivate propertyIList.ItemInfrastructure. Gets or sets an image in an existing ImageList.ImageCollection.
Explicit interface implemetationPrivate methodIList.RemoveInfrastructure. Implements the Remove. Throws a NotSupportedException in all cases.
Top

This is used to manage the images in the ImageList programmatically, providing methods to add and remove image objects.

The following code example shows how to select, remove, and display images, from the Images property of the ImageList class, which is an ImageList.ImageCollection type.

No code example is currently available or this language may not be supported.

.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

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2015 Microsoft