异步一

Winform

1 this.Invoke(new Action(() =>
2                         {
3 
4                         }));

Wpf

   this.Dispatcher.Invoke(DispatcherPriority.Normal,
                new Action(() =>
                {
                    //调用主线程UI的的代码  
                    ButtonOkClick(this.msg);
                }));
原文地址:https://www.cnblogs.com/dyfisgod/p/6928767.html