怎样获得StringGrid中选中的多个Cell

解决方案 »

  1.   

    set goRangeSelect in grid.options
      

  2.   

    StringGrid1.Selection.Top
    StringGrid1.Selection.Left
    StringGrid1.Selection.Bottom
    StringGrid1.Selection.Right
      

  3.   

    o 错了,
    是StringGrid.Selection
      

  4.   

    StringGrid1.Selection.top,Left(左上角单元格)
    StringGrid1.Selection.Bootom,Right(右下角单元格)
      

  5.   

    得到所有选中CELL的内容var
      i, j : integer;
    begin
      for i := StringGrid1.Selection.Top to StringGrid1.Selection.Bottom do
      for j := StringGrid1.Selection.Left to StringGrid1.Selection.Right do
        Memo1.Lines.Add(StringGrid1.Cells[j,i]);
    end;