Skip to main content

BaseImageListBoxControl.GetItemImageIndex(Int32) Method

Gets the index of the image displayed within the specified item.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v24.1.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

public virtual int GetItemImageIndex(
    int index
)

Parameters

Name Type Description
index Int32

An integer value representing the zero-based index of the item.

Returns

Type Description
Int32

An integer value representing the zero-based index of the image displayed within the specified item. -1 if no item is found.

Remarks

Each ImageListBoxControl item can display an image contained within the object represented by the BaseImageListBoxControl.ImageList property. The GetItemImageIndex method allows you to get the index of the image displayed in the specified item. This method can be especially useful when the data source is bound to the control. Note that the method returns -1 if the BaseImageListBoxControl.ImageIndexMember property value is set to “” (String.Empty).

When no data source is bound, you can obtain the image index of the specified item via BaseImageListBoxControl.ItemsImageListBoxItem.ImageIndex property.

See Also