ToolStripItem::ImageKey Property

 

Gets or sets the key accessor for the image in the ImageList that is displayed on a ToolStripItem.

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

public:
[TypeConverterAttribute((ImageKeyConverter^::typeid))]
[BrowsableAttribute(false)]
[RelatedImageListAttribute("Owner.ImageList")]
property String^ ImageKey {
	String^ get();
	void set(String^ value);
}

Property Value

Type: System::String^

A string representing the key of the image.

The ImageIndex property specifies the position of the image in the image list. The ImageKey property specifies the image itself.

The Image, ImageAlign, ImageIndex, ImageKey, and ImageScaling properties pertain to various aspects of image handling. Use images in ToolStrip controls by setting these properties directly or by setting the run-time–only ImageList property.

Image scaling is determined by the interaction of properties in both ToolStrip and ToolStripItem, as follows:

The following code example demonstrates how to set the ImageKey property. This code example is part of a larger example provided for the ToolStripItem class.

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

.NET Framework
Available since 2.0
Return to top
Show: