Method GetImage
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
itemListControlItemThe list control item for which to retrieve the image. Can be null if no item is specified.
listBoxIListControlItemContainerThe container that holds the list control item. Can be null if the item is not associated with a container.
isSelectedbooltrue 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
isSelectedbooltrue 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.