Skip to main content
A newer version of this page is available.

Example: OnGetHotTrackStyle

The following sample shows the use of the OnGetHotTrackStyle event. The event handler changes the style of a node depending on the node level.

The sample requires that an instance of the style repository is available. The repository should contain at least two styles: a style for hot-tracked root level nodes (stlHotRoot) and a style for other nodes (stlHotItem).

procedure <Form>.<TreeList>GetHotTrackStyle(Sender: TcxCustomTreeList; AColumn: TcxTreeListColumn; ANode: TcxTreeListNode; var AStyle: TcxStyle);
begin
  if ANode.Level = 0 then
    AStyle := stlHotRoot
  else
    AStyle := stlHotItem;
end;