OnScroll event example for Delphi

Before using this example you must add an Edit control to your form. Then, you can exercise this example by coding a command button that loads an image with the AutoScroll property set to True.

procedure TForm1.Lead1Scroll(Sender: TObject);

begin
Edit1.Text := 'Image origin: ' +
      IntToStr(round(Lead1.DstLeft)) + ', ' +
      IntToStr(round(Lead1.DstTop));
end;