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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top