/// <summary> /// Opens the form to allow the user to add a new recurring income /// </summary> /// <param name="sender">Standard sender object</param> /// <param name="e">Standard event object</param> private void recurringIncomeToolStripMenuItem_Click(object sender, EventArgs e) { // If the instance is not already open if (NewRecurringIncome == null) { MdiChilrenSum++; RecurringIncomeInput ChildData = new RecurringIncomeInput(); ChildData.MdiParent = this; ChildData.Show(); ChildData.FormClosed += new FormClosedEventHandler(MdiChildClosed); ChildData.FormClosed += new FormClosedEventHandler(NewRecurringIncomeClose); } // Forces the form to the front else { NewRecurringIncome.BringToFront(); } }
/// <summary> /// Opens the form to allow the user to add a new recurring income /// </summary> /// <param name="sender">Standard sender object</param> /// <param name="e">Standard event object</param> private void RecurringIncomeToolStripMenuItem_Click(object sender, EventArgs e) { // If the instance is not already open if (NewRecurringIncome == null) { MdiChilrenSum++; var childData = new RecurringIncomeInput { MdiParent = this }; childData.Show(); childData.FormClosed += MdiChildClosed; childData.FormClosed += NewRecurringIncomeClose; } // Forces the form to the front else { NewRecurringIncome.BringToFront(); } }
/// <summary> /// When the new recurring income form is closed, sets the main forms property to null /// </summary> /// <param name="sender">Standard sender object</param> /// <param name="e">Standard event object</param> private void NewRecurringIncomeClose(object sender, FormClosedEventArgs e) { NewRecurringIncome = null; }