using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace MaiMuAOI.SysUI.ProductAndStep { public partial class WaitFrm : Form { public WaitFrm(EventHandler Method, string msg) { InitializeComponent(); if (!string.IsNullOrEmpty(msg)) lblTip.Text = msg; _Method = Method; } private EventHandler _Method; private IAsyncResult asyncResult; private void timer1_Tick(object sender, EventArgs e) { if (asyncResult.IsCompleted) this.Close(); } /// /// 窗体第一次加载事件 /// /// /// private void FrmWaitingBox_Shown(object sender, EventArgs e) { asyncResult = _Method.BeginInvoke(null, null, null,null); } } }