Recently in FMX, I was trying to reset the scrolling position of the TVertScrollBox to the top when re-showing a frame:
The solution is to use the ScrollBy function.
You have to specify how many pixels you would like to move backwards from the current position. For example, if my current Y position is 100 and I want to move to the top, then I would invoke ScrollBy(0, 100).
To move forwards (down for Y, right for X) you need to supply a negative value, i.e. ScrollBy(0, -100).
To determine your current position:
var y := Scroller.ViewportPosition.Y var x := Scroller.ViewportPosition.X
To scroll to the top:
An alternative is to just set the ViewportPosition property absolutely:
Scroller.ViewportPosition := PointF(0, 0);
If the contents are not aligned correctly:
I hope this tip may be useful.