Srcee 0 Junior Poster in Training

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."`

I try to use this:

context.Post(new SendOrPostCallback(newMethod), (object)proba);

where context is the context of the main thread and newMethod initializes the value of richTextBoxLog. However, this call is in the method which is started by the new thread, in a while loop:

while (-1 != (ch = _reader.Read()))
            {
                Console.Write((char)ch);
                proba += ((char)ch).ToString();
                context.Post(new SendOrPostCallback(newMethod), (object)proba);                
            }
            _complete.Set();
        }

The problem I have now is that I want newMethod to be called every time when I enter in the while loop. But, what's happening is: the while loop finishes and after that newMethod is entered about thousand times.