怎么样实现双击所选单元后可以对其进行编辑,并把编辑后的结果保存?!
多谢!!!!

解决方案 »

  1.   

    选中的区域:StringGrid1.Selection
      

  2.   

    procedure TForm1.StringGrid1DblClick(Sender: TObject);
    var
     Rowindex,ColIndex:integer;
    begin
     StringGrid1.Options:=StringGrid1.Options+[goEditing];
     Rowindex:= StringGrid1.Row; //获取行索引
     ColIndex:= StringGrid1.Col;//获取列索引
     showmessage( Inttostr(Rowindex)+': '+ Inttostr(ColIndex))
    end;
      

  3.   

    procedure TForm1.StringGrid1DblClick(Sender: TObject);
    var
      Rows: Integer;
      a: string;
    begin
      Rows := sgOperators.Selection.Bottom  ;
      a := StrToInt(sgOperators.Cells[0, Rows]);
      根据updata 字段='' where 字段=a 保存结果  .......
    end