stringgrid1.Rows[k+1]:=stringgrid1.Rows[k];

解决方案 »

  1.   

    可以这样实现,MouseToCell
    ....
    var
      Form1: TForm1;
      IsDrag:boolean;
      StringSource:string;
    implementation{$R *.DFM}procedure TForm1.StringGrid1MouseMove(Sender: TObject; Shift: TShiftState;
      X, Y: Integer);
    var
      Column, Row: Longint;
    beginif ssleft in shift then begin
         StringGrid1.MouseToCell(X, Y, Column, Row);
      if not IsDrag then begin
         IsDrag:=true;
         StringSource:=StringGrid1.Cells[1,1];
        end
      else
    StringGrid1.Cells[Column, Row]:=StringSource;
        end;end;procedure TForm1.FormCreate(Sender: TObject);
    begin
      IsDrag:=false;
      StringGrid1.Cells[1, 1]:='这里是要复制的内容';
    end;procedure TForm1.StringGrid1MouseUp(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    begin
      isdrag:=false;
    end;
      

  2.   

    鼠标控制比较不爽,鼠标松开后, StringGrid1.Cells[X1, Y1] := StringGrid1.Cells[X2, Y2]
      

  3.   

    to lile_zhy() 
    stringgrid怎么没反应呀!!!