/// <summary> /// 无参数并且无返回值 /// </summary> /// <param name="method"></param> public void NonParmAndNonReturnMethod(DelegateNonParmAndNonReturn method) { nonParmAndNonReturn = method; formloading = new FrmLoading(); formloading.backgroundWorker1.DoWork += new DoWorkEventHandler(backgroundWorkerLoad_NonParmAndNonReturn); SetDisplayText(Desc); formloading.ShowDialog(); formloading.Close(); }
private void FrmFilterSuratKeluar_Load(object sender, EventArgs e) { InitControl(); Thread t = new Thread(Init); t.IsBackground = true; t.Start(); frmLoading = new FrmLoading(); frmLoading.ShowDialog(); }
/// <summary> /// 有参数并且无返回值 /// </summary> /// <param name="method"></param> /// <param name="para"></param> public void HasParmAndNonReturnMethod(DelegateHasParmAndNonReturn method, object para = null) { parmLoading = para; hasParmAndNonReturn = method; formloading = new FrmLoading(); formloading.backgroundWorker1.DoWork += new DoWorkEventHandler(backgroundWorkerLoad_HasParmAndNonReturn); SetDisplayText(Desc); formloading.ShowDialog(); formloading.Close(); }
private void BindingDataGrid() { gvHistoryLoginUser.Rows.Clear(); Thread bindingDataSurat; bindingDataSurat = new Thread(GenerateDataHistory); bindingDataSurat.IsBackground = true; bindingDataSurat.Start(); frmLoading = new FrmLoading(); frmLoading.ShowDialog(); }
/// <summary> /// 开始加载 /// </summary> /// <param name="message">消息</param> /// <param name="ownerForm">父窗体</param> /// <param name="work">待执行工作</param> /// <param name="workArg">工作参数</param> public static void ShowLoading(string message, Form ownerForm, ParameterizedThreadStart work, object workArg = null) { var loadingForm = new FrmLoading(message); dynamic expandoObject = new ExpandoObject(); expandoObject.Form = loadingForm; expandoObject.WorkArg = workArg; loadingForm.SetWorkAction(work, expandoObject); loadingForm.ShowDialog(ownerForm); if (loadingForm.WorkException != null) { throw loadingForm.WorkException; } }