IDimensionNodeGetImageEventArgs.ImageIndex

Syntax

ImageIndex: Integer;

Description

The ImageIndex property determines index of the image that is located to the left of element text in the first component column.

Example

Executing the example requires a form, the DimensionTree component named DimensionTree1, the UiDimension component, that is a data source for the DimensionTree1, and the ImageList component containing the images set. ImageList is implemented in the Images component for the DimensionTree1 component. UiDimension is linked to any dictionary. The following procedure is implemented as the OnGetNodeImage event handler for the DimensionTree1 component.

Sub DimensionTree1OnGetNodeImage(Sender: Object; Args: IDimensionNodeGetImageEventArgs);

Begin

Select Case Args.State

Case DimensionViewerNodeState.None: Args.ImageIndex := -1;

Case DimensionViewerNodeState.Selected: Args.ImageIndex := 0;

Case DimensionViewerNodeState.Focused: Args.ImageIndex := 1;

Case DimensionViewerNodeState.SelectedFocused: Args.ImageIndex := 2;

Case DimensionViewerNodeState.Expanded: Args.ImageIndex := 3;

End Select;

End Sub DimensionTree1OnGetNodeImage;

On occurring the event of the element, for which the event was generated, the corresponding image is set according to the element state.

See also:

IDimensionNodeGetImageEventArgs