Back to Devexpress

XtraMdiTabPage.ImageIndex Property

windowsforms-devexpress-dot-xtratabbedmdi-dot-xtramditabpage-6aad5932.md

latest4.8 KB
Original Source

XtraMdiTabPage.ImageIndex Property

Gets or sets the index of the image displayed within the tab page’s header.

Namespace : DevExpress.XtraTabbedMdi

Assembly : DevExpress.XtraBars.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

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

Property Value

TypeDefaultDescription
Int32-1

A zero-based integer value specifying the index of an image within the XtraTabbedMdiManager.Images list.

|

Remarks

Tab pages can display images in headers.

The ImageOptions property provides access to image-related settings. Use the following properties to display the raster or vector image in the header:

SvgImageSpecifies a vector image (SVG) for the tab header.ImageSpecifies a raster image for the tab header.ImageIndexSpecifies the index of an image from the XtraTabbedMdiManager.Images collection.

The Image property has priority over the ImageIndex property.

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.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ImageIndex property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-tabbed-mdi-manager-display-custom-header-button/CS/WindowsFormsApplication32/Form1.cs#L32

csharp
XtraTabbedMdiManager tabbedMdi = (XtraTabbedMdiManager)sender;
    e.Page.ImageIndex = tabbedMdi.Pages.Count - 1;
}

winforms-tabbed-mdi-manager-display-custom-header-button/VB/WindowsFormsApplication32/Form1.vb#L29

vb
Dim tabbedMdi As XtraTabbedMdiManager = CType(sender, XtraTabbedMdiManager)
    e.Page.ImageIndex = tabbedMdi.Pages.Count - 1
End Sub

See Also

ImageOptions

Images

StartAnimation()

StopAnimation()

UseFormIconAsPageImage

XtraMdiTabPage Class

XtraMdiTabPage Members

DevExpress.XtraTabbedMdi Namespace