/// <summary> /// TO create a new uledger using the button click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnNewAccountLedger_Click(object sender, EventArgs e) { try { if (cmbAccountLedger.SelectedValue != null) { strAccountLedger = cmbAccountLedger.SelectedValue.ToString(); } else { strAccountLedger = "0"; } frmAccountLedger frmAccountLedgerObj = new frmAccountLedger(); frmAccountLedgerObj.MdiParent = formMDI.MDIObj; frmAccountLedger open = Application.OpenForms["frmAccountLedger"] as frmAccountLedger; if (open == null) { frmAccountLedgerObj.WindowState = FormWindowState.Normal; frmAccountLedgerObj.MdiParent = formMDI.MDIObj; frmAccountLedgerObj.CallThisFormFromPDCPayable(this); } else { open.MdiParent = formMDI.MDIObj; open.BringToFront(); open.CallThisFormFromPDCPayable(this); if (open.WindowState == FormWindowState.Minimized) { open.WindowState = FormWindowState.Normal; } } this.Enabled = false; } catch (Exception ex) { MessageBox.Show("PP35:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }