windowsforms-devexpress-dot-xtraeditors-dot-controls-dot-imageslider-60626336.md
Gets or sets the index of the image currently displayed in the ImageSlider control.
Namespace : DevExpress.XtraEditors.Controls
Assembly : DevExpress.XtraEditors.v25.2.dll
NuGet Package : DevExpress.Win.Navigation
[DefaultValue(-1)]
[DXCategory("Behavior")]
public int CurrentImageIndex { get; set; }
<DXCategory("Behavior")>
<DefaultValue(-1)>
Public Property CurrentImageIndex As Integer
| Type | Default | Description |
|---|---|---|
| Int32 | -1 |
An integer value that specifies the zero-based index of the image currently displayed in the ImageSlider control.
|
The source of images can be specified by the ImageSlider.Images or ImageSlider.ImageList property. The CurrentImageIndex property allows you to programmatcally specify the index of the image to be displayed in the ImageSlider control. To accomplish the same goal, you can use the ImageSlider.SetCurrentImageIndex method, which allows you to specify whether to use slide animation when changing the display image.
Changing the currently displayed image fires the ImageSlider.CurrentImageIndexChanged event.
To get the currently displayed image, use the ImageSlider.CurrentImage property.
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the CurrentImageIndex 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-grid-image-slider-cell-editor/CS/WindowsFormsApplication202/ImageSliderHelper.cs#L48
ImageSlider slider = sender as ImageSlider;
if (slider.CurrentImageIndex != -1 && slider.ImageList != null && canSaveFirstImage) {
if (!isFirstImageFound) {
winforms-grid-image-slider-cell-editor/VB/WindowsFormsApplication202/ImageSliderHelper.vb#L52
Dim slider As ImageSlider = TryCast(sender, ImageSlider)
If slider.CurrentImageIndex <> -1 AndAlso slider.ImageList IsNot Nothing AndAlso canSaveFirstImage Then
If Not isFirstImageFound Then
See Also