怎样实现
  双击stringgrid中某一行时,将这一行的值赋值给若干个edit

解决方案 »

  1.   

    procedure TForm1.StringGrid1DblClick(Sender: TObject);
    var i:integer;
    begin
      i:=StringGrid1.Row;
      edit1.text:=StringGrid1.Cells[0,i];
      edit2.text:=StringGrid1.Cells[1,i];
      edit3.text:=StringGrid1.Cells[2,i];
      edit4.text:=StringGrid1.Cells[3,i];
      .......
    end;
      

  2.   

    m:=StringGrid1.Row;
    for i:=0 to self.ComponentCount-1 do
      begin
        for j:=0 to StringGrid1.colcount-1 do
          begin
            if  self.Components[i].Tag =j then
              begin
                 tedit(self.Components[i]).Text :=stringgrid1.cell[j,m];
              end;
          end;
      end;