private delegate void AsyncDel(); private void Do() { AsyncDel del = new AsyncDel(DoWork); AsyncCallback callback = new AsyncCallback(CallBack); del.BeginInvoke(callback, del); } private void CallBack(IAsyncResult r) { var adel = r.AsyncState as AsyncDel; btnOrder.Enabled = true; adel.EndInvoke(r); } private void DoWork() { Thread.Sleep(3000); }
原文地址:http://www.cnblogs.com/Rannie/p/3978652.html