procedure TForm1.TreeView1AdvancedCustomDrawItem(Sender: TCustomTreeView;
Node: TTreeNode; State: TCustomDrawState; Stage: TCustomDrawStage;
var PaintImages, DefaultDraw: Boolean);
var
NodeRect: TRect;
begin
if Stage = cdPostPaint then
begin
NodeRect := Node.DisplayRect(True);
TreeView1.Canvas.Font.Color := clBlue;
TreeView1.Canvas.Brush.Style := bsClear;
TreeView1.Canvas.TextOut(NodeRect.Right, NodeRect.Top + 2, '('+IntToStr(Node.Count)+')');
end;
end;