Table of Contents

Method GetImage

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

GetImage(ListControlItem?, IListControlItemContainer?, bool)

Retrieves the image associated with the specified list control item, based on its selection and enabled state.

public virtual Image? GetImage(ListControlItem? item, IListControlItemContainer? listBox, bool isSelected)

Parameters

item ListControlItem

The list control item for which to retrieve the image. Can be null if no item is specified.

listBox IListControlItemContainer

The container that holds the list control item. Can be null if the item is not associated with a container.

isSelected bool

true if the item is currently selected; otherwise, false.

Returns

Image

The image corresponding to the item's current state, or null if no image is available for the specified item and state.

Remarks

The returned image reflects the item's visual state: selected, normal, or disabled, depending on the parameters provided and the enabled state of the container.

GetImage(bool)

Retrieves the image associated with the current item state, based on whether the item is selected and enabled.

public virtual Image? GetImage(bool isSelected)

Parameters

isSelected bool

true to retrieve the image for the selected state; false to retrieve the image for the normal or disabled state.

Returns

Image

An Image representing the item's visual state. Returns null if no image is defined for the current state.

Remarks

If the item is disabled, the disabled image is returned regardless of the selection state. If the item is enabled, the selected or normal image is returned based on the value of isSelected.