如题

解决方案 »

  1.   

    在StringGrid的DrawCell事件中,
    根据不同的Col和Row,设置不同的Brush.Color / Font.Color,
    最后重新画出这个Cells[Col,Row]的内容就行!
    TextOut等画
      

  2.   

    procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
      Rect: TRect; State: TGridDrawState);
    begin
      with StringGrid1 do
      with Canvas do
      begin
        FillRect(Rect);
        if ARow = 2 then  //如果是第二行则改颜色,其他行类推
          Font.Color := clRed;
        DrawText(Handle, PChar(Cells[ACol, ARow]), Length(Cells[ACol, ARow]),
                 Rect, DT_LEFT+DT_SINGLELINE+DT_VCENTER);
      end;
    end;
    end;
      

  3.   

    还有将DeafultDrawing设为:False;再用楼上几位高手们的方法就可以了