有个朋友说是画上去的 可是到底怎么画,请大侠指教  谢谢

解决方案 »

  1.   

    procedure TfrmMain.DrawGridDrawCell(Sender: TObject; ACol, ARow: Integer;
      Rect: TRect; State: TGridDrawState);
    var
      Text:String;
    begin
      with Sender as TDrawGrid do
      begin
        Canvas.Font.Size:=9;
        Canvas.Font.Color:=clBlue;
        Text:='要写的字';
        Canvas.TextOut(Rect.Left,Rect.Top,Text);//写字
      end;
    end;
      

  2.   

    procedure TfrmMain.DrawGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
      Rect: TRect; State: TGridDrawState);
    var
      CardNoStr:String[17];
    begin
      DrawGrid1.Canvas.Brush.Color := clWhite
      DrawGrid1.Canvas.FillRect(Rect);
      CardNoStr := 'aaa';
      DrawGrid1.Canvas.TextOut(Rect.Left, Rect.Top, CardNoStr);
       
      DrawGrid1.Update;
    end;