public void SetFinish(string alertMessage) { //MessageBox.Show("总耗时:" + Newtonsoft.Json.JsonConvert.SerializeObject(PFDataHelper.GetTimeSpan(DateTime.Now - _beginTime))); //// 采用Invoke形式进行操作 this.Invoke(new MethodInvoker(() => { this.lbl_tips.Text = "操作已完成"; this.lbl_tips_son.Text = "总耗时:" + PFDataHelper.GetTimeSpan(DateTime.Now - _beginTime).ToString(); this.lbl_tips.ForeColor = System.Drawing.Color.Blue; this.lbl_tips_son.ForeColor = System.Drawing.Color.Blue; MessageBox.Show(alertMessage); })); }