procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
begin
with Sender as TStringGrid do begin
if (ARow mod 2 =0) then begin //当行为偶数色为
Canvas.Brush.Color := clBtnFace;//画布颜色
Canvas.font.Color:=clblack;//字体色
end
else
begin
Canvas.Brush.Color := clgreen;
Canvas.font.Color := clWhite;
end;
Canvas.FillRect(Rect);
canvas.textout(rect.Left,rect.Top,cells[Acol,ARow]);
end;
end;