- 结果如图

- 方法
- 需要去重写cxTreeList的重绘事件,也就是OnCustomDrawDataCell事件。
procedure TForm13.lst1CustomDrawDataCell(Sender: TcxCustomTreeList; ACanvas:
TcxCanvas; AViewInfo: TcxTreeListEditCellViewInfo; var ADone: Boolean);
begin
AViewInfo.EditViewInfo.OnDrawBackground := OnDrawBackground;
end;
procedure TForm13.OnDrawBackground(Sender: TcxCustomEditViewInfo;
ACanvas: TcxCanvas; var AHandled: Boolean);
var
x, y: Integer;
PointA, PointB, PointC: TPoint;
begin
ACanvas.Pen.Color := clRed;
x := Sender.InnerEditRect.Right;
y := Sender.InnerEditRect.Top;
PointA := Point(x, y);
PointB := Point(x - 6, y);
PointC := Point(x, y + 6);
ACanvas.Brush.Color := clRed;
ACanvas.Polygon([PointA, PointB, PointC]);
end;