ACAT.Lib.Core.Utility.Windows.CloseForm C# (CSharp) Метод

CloseForm() публичный статический Метод

Closes the specified form This is just a helper function that takes care of cross-thread invokations that would result in .NET exceptions.
public static CloseForm ( Form form ) : void
form System.Windows.Forms.Form Form to close
Результат void
        public static void CloseForm(Form form)
        {
            if (form.InvokeRequired)
            {
                form.Invoke(new closeForm(CloseForm), form);
            }
            else
            {
                form.Close();
            }
        }

Usage Example

Пример #1
0
 /// <summary>
 /// Confirm and close the scanner
 /// </summary>
 private void close()
 {
     if (EvtDone != null)
     {
         EvtDone.BeginInvoke(false, null, null);
     }
     else
     {
         if (DialogUtils.ConfirmScanner(PanelManager.Instance.GetCurrentForm(), R.GetString("CloseQ")))
         {
             Windows.CloseForm(this);
         }
     }
 }