//cxGrid加行标,找到下列事件,把Var后面的代码完整拷贝过去就可以了。 procedure TMsgBox_Form.cgDetCustomDrawIndicatorCell( Sender: TcxGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxCustomGridIndicatorItemViewInfo; var ADone: Boolean); var FValue: string; FBounds: TRect; begin if (AViewInfo is TcxGridIndicatorRowItemViewInfo) then begin FValue := IntToStr(TcxGridIndicatorRowItemViewInfo(AViewInfo).GridRecord.Index + 1); FBounds := AViewInfo.Bounds; ACanvas.FillRect(FBounds); ACanvas.DrawComplexFrame(FBounds, clBtnHighlight, clBtnShadow, [bBottom, bLeft, bRight], 1); InflateRect(FBounds, -1, -1); ACanvas.Font.Color := clBlack; ACanvas.Brush.Style := bsClear; ACanvas.DrawText(FValue, FBounds, cxAlignCenter or cxAlignTop); ADone := True; end; end;
|