ONDrawCell这个事件,你可以查帮助,有例子!

解决方案 »

  1.   

    procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
      Rect: TRect; State: TGridDrawState);
    begin
      with StringGrid1 do
      begin
        if (ACol <> 0) and (ARow <> 0) then
        begin
          if ACol mod 2 = 0 then
            Canvas.Brush.Color := clYellow
          else
            Canvas.Brush.Color := clGreen;
          Canvas.FillRect(Rect);
          Canvas.TextOut(Rect.Left + 2, Rect.Top + 2, Cells[ACol, ARow]);
        end;
      end;
     end;
    大体思路就是这些,具体的自己加工把!!