//WinForm用法
Thread thread = new Thread(p=> { Action action = new Action(() => { System.Windows.Forms.MessageBox.Show("test"); }); action.Invoke(); }); thread.IsBackground = true; thread.Start();
//WPF用法
Thread thread = new Thread(p=> {

            this.Dispatcher.Invoke(new Action(delegate {System.Windows.Forms.MessageBox.Show("test");}));

                });
                thread.IsBackground = true;
                thread.Start();
 

 

相关文章:

  • 2022-12-23
  • 2021-06-13
  • 2021-06-20
  • 2022-12-23
  • 2021-09-05
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-28
  • 2021-04-24
相关资源
相似解决方案