StringGridの選択行を一つ上に移動する

private部へ選択行の位置情報を保持する変数を記載。
ButtonのOnClickイベントに記述する

使用コンポーネント
TStringGrid TButton



private
 ActRow: Integer;//StringGrid1のアクティブ列情報


procedure TForm1.Button1Click(Sender: TObject);
var
 sList: TStringList;
begin
 if ActRow = 1 then
  Exit;

 sList := TStringList.Create;
 try
  sList.Assign(StringGrid1.Rows[ActRow]);
  StringGrid1.Cells[0,ActRow] := StringGrid1.Cells[0,ActRow-1];
  StringGrid1.Cells[1,ActRow] := StringGrid1.Cells[1,ActRow-1];
  StringGrid1.Cells[2,ActRow] := StringGrid1.Cells[2,ActRow-1];
  StringGrid1.Cells[3,ActRow] := StringGrid1.Cells[3,ActRow-1];
  StringGrid1.Rows[ActRow-1].Assign(sList);
 finally
  sList.Free;
 end;
 if ActRow <> 1 then
  ActRow := ActRow - 1;

 StringGrid1.Row := ActRow;
end;