.Net: How get a TextBox scroll bar to stay at bottom to build a scrolling status display?
Posted on 2008-10-14
Background: I have a standard System.Windows.Forms.TextBox on a form and want it to scroll status messages for my program like this:
with the newest event always on the bottom. The problem is this: The events list from top to bottom but the scroll bar stays at top and I have to manually scroll down to see new events as they are added. I want this automatic.
Question: How do you get a TextBox scroll bar to stay at the bottom so the newest text added is always shown?
Details: I set:
and am appending text like this:
tbOutput.Text += "Some Event Message\r\n";
Challenge: Is TextBox the "right tool for the job" or is there a better component?