/// <summary> /// Open a existing Customer List or create a new one, and give it focus. /// </summary> private void ClickNewCustomerList(object sender, EventArgs e) { // Get the current instance of the CustomerEntry form or create a new one if not there formCustomerEntry customerList = formCustomerEntry.Instance; // Assign it's MDI parent to be the form this event was called in customerList.MdiParent = this; // Dispaly the form and give focus customerList.Show(); customerList.Focus(); }
/// <summary> /// When the form is closed release the instance. /// </summary> private void CustomerFormClosed(object sender, FormClosedEventArgs e) { instance = null; }