Write to RichTextBox from thread

  • Thread starter Thread starter Dmitri Shvetsov
  • Start date Start date
D

Dmitri Shvetsov

Hi,

Does anybody know how to write to richTextBox from thread?

All variables using by thread should be static, including the thread method
(body). The richTextBox control is used on a main form and I have no chance
to make it static. VS refuses to use this control to place a text there
(like a log from thread). How can I do that? Any possible way and/or control
to use it on the form and to write some text from the static method (thread)
would be appreciated.

Thanks,
Dmitri
 
If you don't care about being thread-safe you can set the properties of the textbox and form not to check for cross thread calls
Code:
RichTextBox1.CheckForIllegalCrossThreadCalls = False
 

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