delphi cxgrid自定义画焦点框,把自带的虚线框去掉

参考资料
将 FocusRect 从虚线更改为实线或更改 FocusRect 的颜色 |DevExpress 支持
如何在 TableView 网格中的整个选定/聚焦行周围绘制边框? |DevExpress 支持

 

procedure TcxGridTableView.DoCustomDrawCell(ACanvas: TcxCanvas;
  AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
var
 bounds: TRect;
begin
 if  AViewInfo.Focused and AViewInfo.Item.Focused and (Self.Controller.EditingItem = AViewInfo.Item) then
 begin
  AViewInfo.EditViewInfo.Paint(ACanvas); //重点,把之前的内容先画一下
  bounds:= AViewInfo.EditBounds;
  InflateRect(bounds, 1,1);
  ACanvas.DrawComplexFrame(bounds, FCustomFocusRectColor, FCustomFocusRectColor, cxBordersAll, FCustomFocusBorderWidth);
  ADone := True;
 end;

 

posted @ 2024-05-19 11:34  Tag  阅读(8)  评论(0编辑  收藏  举报