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(); 
        }

相关文章:

  • 2021-11-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-11
猜你喜欢
  • 2022-02-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-06
  • 2021-09-18
  • 2022-01-02
相关资源
相似解决方案