TextBox in another thread

  • Thread starter Thread starter Alan
  • Start date Start date
A

Alan

Hi all,
I use one worker thread to do some lengthy stuff. During doing those things,
I want to output some text to my main thread with message loop. I use one
textbox that is created in main thread.

the key code like this:

this.TextBox.Focus();
this.TextBox.SelectionStart = this.TextBox.Text.Length;
this.TextBox.ScrollToCaret();

But the result is the cursor still remained at start! Are there any ideas?

Thanks.

Alan
 
Alan said:
I use one worker thread to do some lengthy stuff. During doing those things,
I want to output some text to my main thread with message loop. I use one
textbox that is created in main thread.

the key code like this:

this.TextBox.Focus();
this.TextBox.SelectionStart = this.TextBox.Text.Length;
this.TextBox.ScrollToCaret();

But the result is the cursor still remained at start! Are there any ideas?

See
http://www.pobox.com/~skeet/csharp/multithreading.html#windows.forms
 
Back
Top