參考資料
將 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 then begin AViewInfo.EditViewInfo.Paint(ACanvas); //重點,把之前的內容先畫一下 bounds:= AViewInfo.EditBounds; InflateRect(bounds, 1,1); ACanvas.DrawComplexFrame(bounds, FCustomFocusRectColor, FCustomFocusRectColor, cxBordersAll, FCustomFocusBorderWidth); ADone := True; end;