OnRowMoved (Delphi)

From RAD Studio Code Examples
Jump to: navigation, search

Description

The following code displays the number of rows corresponding to how much a row was moved. To move rows in a TStringGrid, goRowMoving must be included in the Options property.

Code

procedure TForm1.StringGrid1RowMoved(Sender: TObject; FromIndex, ToIndex: Longint);
begin
  Label1.Caption := IntToStr(Abs(FromIndex-ToIndex));
end;

Uses