Skip to main content

ImageSlider.SetCurrentImageIndex(Int32, Boolean) Method

Sets the index of the image currently displayed within the current ImageSlider. The method’s parameter specifies whether to use the slide animation.

Namespace: DevExpress.XtraEditors.Controls

Assembly: DevExpress.XtraEditors.v23.2.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

public void SetCurrentImageIndex(
    int imageIndex,
    bool animated
)

Parameters

Name Type Description
imageIndex Int32

An integer value that specifies the zero-based index of the image to be displayed.

animated Boolean

true, to use the slide animation; otherwise, false.

Remarks

The SetCurrentImageIndex method allows you to display an image that occupies a specific position within the ImageSlider.Images or ImageSlider.ImageList collection. The animated parameter specifies whether the image is changed using the slide animation.

Changing the currently displayed image fires the ImageSlider.CurrentImageIndexChanged event.

To get the currently displayed image or its index, use the ImageSlider.CurrentImage or ImageSlider.CurrentImageIndex property, respectively.

See Also