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;
void __fastcall <Form>::<TreeList>GetHotTrackStyle(TcxCustomTreeList *Sender, TcxTreeListColumn * AColumn, TcxTreeListNode *ANode, TcxStyle *&AStyle) {
if (ANode->Level == 0)
AStyle = stlHotRoot;
else
AStyle = stlHotItem;
}