Пример #1
0
 private void ShowWaitForm()
 {
     try
     {
         waitForm = new WaitForm();
         waitForm.SetText(_msg);
         if (_control is Form)
         {
             Point loc = _control.Location;
             waitForm.Left = loc.X + (_control.Bounds.Width - waitForm.Width) / 2;
             waitForm.Top  = loc.Y + (_control.Bounds.Height - waitForm.Height) / 2;
         }
         else
         {
             Point loc = _control.ParentForm.Location;
             waitForm.Left = loc.X + (_control.ParentForm.Bounds.Width - waitForm.Width) / 2;
             waitForm.Top  = loc.Y + (_control.ParentForm.Bounds.Height - waitForm.Height) / 2;
         }
         waitForm.ShowDialog();
     }
     catch (ThreadAbortException ex)
     {
         waitForm.Close();
         Thread.ResetAbort();
         LogHelper.WriteLog(ex.Message, ex);
     }
 }
Пример #2
0
 /// <summary>
 /// 关闭窗体
 /// </summary>
 private void CloseForm()
 {
     if (waitThread != null)
     {
         waitForm.Close();
     }
 }