Controlling the focus in a scrolling window requires care. When the user clicks outside the scrolling window, the focus will leave the scrolling window. When the focus returns to the scrolling window, there is no way to determine to which line of the scrolling window the focus will return.
To solve this problem, avoid creating situations where the user must click outside the scrolling window. If the user must click push buttons outside the scrolling window, be sure set the Hyperspace property for the push button to true. This will ensure that the focus never actually leaves the scrolling window when the push button is clicked.