//private void btnOpenBatchStoreEmailForm_Click(object sender, RibbonControlEventArgs e) //{ // LaunchBatchStoreEmailTool(false); //} //private void btnLaunchTestMode_Click(object sender, RibbonControlEventArgs e) //{ // LaunchBatchStoreEmailTool(true); //} private void LaunchBatchStoreEmailTool(bool TestMode) { if (thisBatchForm == null) { thisBatchForm = new FrmBatchStoreEmailTool(); thisBatchForm.FormClosed += ThisBatchForm_FormClosed; if (TestMode == true) { thisBatchForm.SetTestMode(); } thisBatchForm.Show(); } else { if (TestMode == true) { thisBatchForm.SetTestMode(); } thisBatchForm.Activate(); } }
private void ThisBatchForm_FormClosed(object sender, System.Windows.Forms.FormClosedEventArgs e) { thisBatchForm.Dispose(); thisBatchForm = null; }