private Thread myTestThread;
        private Form2 form2;

        private void ThreadFunc()
        {
            form2 = new Form2();
            // this.Invoke(new   ThreadStart(showForm2));  

           // MethodInvoker mi = new MethodInvoker(showForm2);
           // mi.BeginInvoke(null, null);

            AsyncEventHandler asy = new AsyncEventHandler(showForm2);
            IAsyncResult ia=asy.BeginInvoke(null,null);
            Event2();
            while (!ia.IsCompleted)
            {
                object bj = ia.AsyncState;
            }
           asy.EndInvoke(ia);
          

        }
        private void showForm2()
        {
          
            form2.Show();
           
        }

        private void Form3_Load(object sender, EventArgs e)
        {
            myTestThread = new Thread(new ThreadStart(ThreadFunc));
            myTestThread.Start(); 
        }

posted on 2010-09-02 22:59  kjunmine  阅读(290)  评论(0)    收藏  举报