procedure TMyTable.MyBandedTableViewCustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean); var bounds: TRect; begin if AViewInfo.Focused then begin bounds:= AViewInfo.Bounds; Dec(bounds.Right, 1); Dec(bounds.Bottom,1); ACanvas.DrawComplexFrame(bounds, clBlack, clBlack, cxBordersAll, 2); aDone := True; end; //删除选中背景颜色,一般可以通过设置去掉.不用也行 if AViewInfo.Selected then begin if Odd(AViewInfo.GridRecord.RecordIndex) then ACanvas.FillRect(AViewInfo.Bounds, RootLookAndFeel.Painter.DefaultContentOddColor ) else ACanvas.FillRect(AViewInfo.Bounds, RootLookAndFeel.Painter.DefaultContentEvenColor ); ACanvas.Font.Color := RootLookAndFeel.Painter.DefaultContentTextColor ; end; end;
标签:ACanvas,AViewInfo,end,自定义,delphi,cxgrid,bounds,RootLookAndFeel,Painter From: https://www.cnblogs.com/BTag/p/18200045