예제 #1
0
 /// <summary>
 /// On 'CopyPrinterData' button click
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnCopyPrinterData_Click(object sender, EventArgs e)
 {
     try
     {
         this.Close();
         frmCopyDataPrinter frmCopyData = new frmCopyDataPrinter();
         frmCopyDataPrinter _isOpen     = Application.OpenForms["frmCopyDataPrinter"] as frmCopyDataPrinter;
         if (_isOpen == null)
         {
             frmCopyData.WindowState = FormWindowState.Normal;
             frmCopyData.MdiParent   = formMDI.MDIObj;
             frmCopyData.Show();
         }
         else
         {
             _isOpen.MdiParent = formMDI.MDIObj;
             if (_isOpen.WindowState == FormWindowState.Minimized)
             {
                 _isOpen.WindowState = FormWindowState.Normal;
             }
             if (_isOpen.Enabled)
             {
                 _isOpen.Activate();
                 _isOpen.BringToFront();
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("SPIns:6" + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
 /// <summary>
 /// On 'CopyPrinterData' button click
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnCopyPrinterData_Click(object sender, EventArgs e)
 {
     try
     {
     this.Close();
     frmCopyDataPrinter frmCopyData = new frmCopyDataPrinter();
     frmCopyDataPrinter _isOpen = Application.OpenForms["frmCopyDataPrinter"] as frmCopyDataPrinter;
     if (_isOpen == null)
     {
         frmCopyData.WindowState = FormWindowState.Normal;
         frmCopyData.MdiParent = formMDI.MDIObj;
         frmCopyData.Show();
     }
     else
     {
         _isOpen.MdiParent = formMDI.MDIObj;
         if (_isOpen.WindowState == FormWindowState.Minimized)
         {
             _isOpen.WindowState = FormWindowState.Normal;
         }
         if (_isOpen.Enabled)
         {
             _isOpen.Activate();
             _isOpen.BringToFront();
         }
     }
     }
     catch (Exception ex)
     {
         MessageBox.Show("SPIns:6" + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }