I have a richTextBoxLog which is public and static.
After I declare it, I start a new thread which initializes new variable named proba. richTextBoxLog should get the value from proba.
The problem is, proba needs time to be initialized, and I want richTextBoxLog to initialize while proba is initializing.
I want to write something like:
richTextBoxLogFile.richTextBoxLog.Text += proba;
But, when I write it in the method which is called by the previously mentioned thread, I get an exception: "Cross-thread operation not valid: Control 'richTextBoxLog' accessed from a thread other than the thread it was created on."
Can I write something like this: stop the thread, then initialize richTextBoxLog, then start the thread again, then stop it, and the same continues while initializing richTextBoxLog ends.