掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
StringColGridで行の入れ替えをしたいのですが? (ID:21800)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
StringColGrid は知りませんが、 StringGridなら Optionsプロパティで goRowMoving を Trueにすれば、左のIndicator部分をドラッグして 移動できます。 プログラムで移動させる場合は、こんな感じでどうでしょう? procedure TForm1.Button1Click(Sender: TObject); var cnt: Integer; sl: TStringList; idx_from, idx_to: integer; begin sl := TStringList.Create; try with StringGrid1 do begin { 末尾のデータを先頭に } idx_from := RowCount - 1; idx_to := FixedRows; for cnt := 0 To ColCount - 1 Do begin sl.Assign(Cols[cnt]); sl.Move(idx_from, idx_to); Cols[cnt].Assign(sl); end; end; finally sl.Free; end; end;
←解決時は質問者本人がここをチェックしてください。
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.