call Invoke method from a custom class
<p>i was have a problem like this </p>

<p><a href="http://stackoverflow.com/questions/160555/my-form-doesnt-properly-display-when-it-is-launched-from-another-thread">My form doesn't properly display when it is launched from another thread</a></p>

<p>now my question is how to call Invoke method from a custom class not from a Form</p>

<pre><code>void call_thread()
    {

        Thread t = new Thread(new ThreadStart(this.ShowForm1));
        t.Start();

    }

 delegate void Func();
    private void ShowForm1()
    {            
        if (this.InvokeRequired) //error
        {
            Func f = new Func(ShowForm1);
            this.Invoke(f); //error
        }
        else
        {
            Form1 form1 = new Form1();
            form1.Show();
        }            
    }
</code></pre>
