private static void FormOpenEventTrigger(Form _form)
 {
     try
     {
         if (_form != null && _form.IsDisposed == false)
         {
             EncompassFormOpenedEventArgs eventArgs = new EncompassFormOpenedEventArgs(_form);
             FormOpened.Invoke(null, eventArgs);
         }
     }
     catch (Exception)
     {
         //handle Exception
     }
 }
 private void EncompassMainUI_FormOpened(object sender, EncompassFormOpenedEventArgs e)
 {
     try
     {
         //I always check to make sure form isn't null or disposed, to prevent exceptions
         if (e.OpenedForm != null && e.OpenedForm.IsDisposed == false)
         {
             ControlExport(e.OpenedForm);
             fm = e.OpenedForm;
             e.OpenedForm.Click += OpenedForm_Click;
         }
     }
     catch (Exception ex)
     {
         //handle Exception
     }
 }