Back to Devexpress

BarItem.ImageIndex Property

windowsforms-devexpress-dot-xtrabars-dot-baritem-99b8c61c.md

latest3.6 KB
Original Source

BarItem.ImageIndex Property

Use the BarItemImageOptions.ImageIndex property to assign an image index to an item.

Namespace : DevExpress.XtraBars

Assembly : DevExpress.XtraBars.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual int ImageIndex { get; set; }
vb
<Browsable(False)>
<EditorBrowsable(EditorBrowsableState.Never)>
Public Overridable Property ImageIndex As Integer

Property Value

TypeDescription
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.

csharp
// 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"];
vb
' 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.

See Also

Glyph

LargeImageIndex

BarItemLink.ImageIndex

BarManager.Images

BarItemImageOptions.ImageIndex

RibbonControl.Images

BarItem Class

BarItem Members

DevExpress.XtraBars Namespace