Cross Thread Problem... Help Me
<p>i have 2 script 1- Soket.cs (Soket Server Working with thread) FormMain.cs(Working Normal) i call a function in FormMain from soket.cs with this code :</p>

<pre><code>public void ResiveFunc(string FuncResive)
    {


        string FuncName = "";
        string FuncValue = "";
        for (int i = 0; i &lt;= 2; i++)
        {
            FuncName += FuncResive[i];
        }
        for (int j = 4; j &lt;= FuncResive.Length - 1; j++)
        {
            FuncValue += FuncResive[j];
        }
        MessageBox.Show(FuncName);
        MessageBox.Show(FuncValue);
        if (FuncName == "TAB")
        {
            Form1 mainForm = new Form1();
            mainForm.AdverFilter(FuncValue);
        }
        FuncName = "";
        FuncValue = "";
    }
</code></pre>

<p>i call this AdverFilter() function in FormMain :</p>

<pre><code>public void AdverFilter(string value)
        {
            Messagebox.show(value);
            this.richTextBox1.Text = value;
        }
</code></pre>

<p>but its dont work!!! Messagebox show fine the value but richtextbox is null...
please tell me how can i fix this problem...!?</p>

<hr/>

<h3>Update:</h3>

<p>I changed my code to the following:</p>

<pre><code>    public void AdverFilter(string value)
    {
        if (this.InvokeRequired)
        {
            this.BeginInvoke(new Action&lt;string&gt;(AdverFilter),value);

        }
        else
        {
            MessageBox.Show(value);
            this.richTextBox1.Text = value;
        }

    }
</code></pre>

<p>This code has no syntax errors, but it still doesn't work.  I added <code>MessageBox.Show(richTextBox1.Text);</code> to this code.  It shows <code>true</code> but my Richtextbox is <code>null</code>.</p>
