I'm making a simple log viewer which is composed of a big TextBox
which shows the file, and a DispatchTimer
that updates the TextBox
from time to time by setting its Text
property.
Whenever the focus is set to the TextBox
, it keeps automatically scrolling to the place where the cursor is, even when I'm explicitly issue ScrollToEnd()
on it. (In that case, the UI shows the scrollbar "jumping" from the end back to the cursor position).
How can I cause the TextBox
to keep its current scrolled position and ignore the position of the cursor?