如果怕麻烦,最好用TMS 控件,COOL

解决方案 »

  1.   

    procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
      Rect: TRect; State: TGridDrawState);
    begin
    if ACol=1 then
     begin
       StringGrid1.Canvas.Font.Color :=clPurple;
       StringGrid1.Canvas.TextOut(rect.left+4,Rect.Top+2,'aaa');
     end;end;
      

  2.   

    改变CELLS[1,1]里的字体颜色:
    begin
      r:=1;
      c:=1;
      rect1:=stringgrid1.CellRect(c,r);
      with stringgrid1.Canvas do
      begin
        font.Color := clRed;
        FillRect(Rect1);
        TextOut(Rect1.Left, Rect1.Top, stringgrid1.Cells[c,r]);
      end;
    end;