BarItem.ImageIndex Property
Use the BarItemImageOptions.ImageIndex property to assign an image index to an item.
Namespace: DevExpress.XtraBars
Assembly: DevExpress.XtraBars.v24.2.dll
NuGet Package: DevExpress.Win.Navigation
#Declaration
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual int ImageIndex { get; set; }
#Property Value
Type | Description |
---|---|
Int32 | The index of an image in the collection of small images. |
#Remarks
The ImageIndex
property specifies image index in a collection of small images.
If you are using standard bars from the DevExpress Ribbon, Menu and Docking Library, the BarManager.Images property specifies the source of small images. In a Ribbon Control, the RibbonControl.Images property specifies the source of small images.
You can also use the BarItem.ImageOptions.Image property to assign a small image to the bar item.
If both ImageIndex
and BarItem.ImageOptions.Image properties are set, the image assigned to the BarItem.ImageOptions.Image property will be used.
In standard bars, you can use the BarItemLink.ImageIndex property to assign a custom image to each bar item link.
Tip
You can also assign an image by its name in the collection.
// The image collection is created and populated with images at design time.
barItem.ImageOptions.Image = imageCollection1["technology_32x32"];
// Assign an SVG image in the SvgCollection
// barItem.ImageOptions.SvgImage = svgCollection1["technology_32x32"];
Read the following help topic for more information: Access and Use DevExpress Icons in Code.