TcxTreeListStyles.OnGetHotTrackStyle Event
Allows you to apply different styles to individual hot-tracked nodes.
Declaration
property OnGetHotTrackStyle: TcxTreeListGetContentStyleEvent read; write;
Remarks
You can handle the OnGetHotTrackStyle
event to apply different styles to hot-tracked nodes based on custom conditions.
Event Occurrence
The OnGetHotTrackStyle
event occurs every time a user hot-tracks a node in a Tree List control if its OptionsBehavior.HotTrack property is set to True
.
Event Parameters
You can use Sender
, AColumn
, and ANode
parameters to identify the control that raised the OnGetHotTrackStyle
event and the currently hot-tracked node. The AStyle
parameter allows you to assign an existing style to the currently hot-tracked node.
Refer to the TcxTreeListGetContentStyleEvent procedural type description for detailed information on parameters accessible within OnGetHotTrackStyle
and OnGetContentStyle event handlers.
Code Example
The following code example applies two different styles to root and child tree list nodes:
procedure TMyForm.cxTreeList1GetHotTrackStyle(Sender: TcxCustomTreeList; AColumn: TcxTreeListColumn;
ANode: TcxTreeListNode; var AStyle: TcxStyle);
begin
if ANode.Level = 0 then
AStyle := RootHotTrackStyle;
else
AStyle := ItemHotTrackStyle;
end;