ImageList.ImageCollection.SetKeyName Method (Int32, String)

 
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.

Sets the key for an image in the collection.

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

public void SetKeyName(
	int index,
	string name
)

Parameters

index
Type: System.Int32

The zero-based index of an image in the collection.

name
Type: System.String

The name of the image to be set as the image key.

Exception Condition
IndexOutOfRangeException

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

The name of an image corresponds to its key in the ImageList.ImageCollection. An image key is not case-sensitive.

.NET Framework
Available since 2.0
Return to top
Show: