RichTextBox, ScrollToCarret, No Focus?

  • Thread starter Thread starter Jean-Francois Lord
  • Start date Start date
J

Jean-Francois Lord

Hello,

I have a multithreaded windows app that has a RichTextBox acting as an
output console for the worker threads. I need a way of scrolling down to the
bottom of the RichTextBox as text is added without stealing the focus from
my other controls.

RichTextBox.Focus()
RichTextBox.ScrollToCarret()

This does not work for me since I have an axWebBrowser control and I cannot
restore the focus to it's child controls, i.e. it's text boxes.

Does anyone have a way of scrolling the RichTextBox without stealing the
focus?

Thanks,
Jean Lord
 
* "Jean-Francois Lord said:
I have a multithreaded windows app that has a RichTextBox acting as an
output console for the worker threads. I need a way of scrolling down to the
bottom of the RichTextBox as text is added without stealing the focus from
my other controls.

RichTextBox.Focus()
RichTextBox.ScrollToCarret()

This does not work for me since I have an axWebBrowser control and I cannot
restore the focus to it's child controls, i.e. it's text boxes.

Does anyone have a way of scrolling the RichTextBox without stealing the
focus?

I don't have a solution to your problem, but notice that Windows Forms
controls are not safe for multithreading. You will have to use the
control's 'Invoke' method to call members of the control from an other
thread.
 
Back
Top