Khopkins32
asked on
Using a Rich Text Box to Display Output Stream for a running process in Execution
Dear Expert,
I have a Rich Text Box winform control used to display output stream information of a process in execution. When the text being displayed populates the full height(area) of the rich text box,, it doesn't automatically scroll down. The only way to mimick this behavior is if I click my mouse in the Rich Text Box, just after the end of line of the process text string (i.e placing the cursor in a carriage return line feed position). Is there a way to set the Rich Text Box to automatically stay in scroll down position as output text populates the area of the rich text box.
I current set a string variable equal to the output stream. Then I set "this.text = string variable" to display the output stream.
Regards
-K
I have a Rich Text Box winform control used to display output stream information of a process in execution. When the text being displayed populates the full height(area) of the rich text box,, it doesn't automatically scroll down. The only way to mimick this behavior is if I click my mouse in the Rich Text Box, just after the end of line of the process text string (i.e placing the cursor in a carriage return line feed position). Is there a way to set the Rich Text Box to automatically stay in scroll down position as output text populates the area of the rich text box.
I current set a string variable equal to the output stream. Then I set "this.text = string variable" to display the output stream.
Regards
-K
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
private void ScrollToBottom(System.Wind
{
rtb.Focus();
rtb.Select( rtb.Text.Length, 0 );
rtb.ScrollToCaret();
}
Then you just call this method, and pass the RichTextBox you want to scroll to the bottom.... Handy :-)
-Eric