/// <summary> /// Create a new child instance of Car Inventory form and display it /// </summary> private void ClickNewCarList(object sender, EventArgs e) { // Get the current instance of the CarInventory form or create a new one if not there formCarInventory carList = formCarInventory.Instance; // Assign it's MDI parent to be the form this event was called in carList.MdiParent = this; // Dispaly the form and set it as the focus carList.Show(); carList.Focus(); }
/// <summary> /// When the form is closed release the instance. /// </summary> private void CarInventoryFormClosed(object sender, FormClosedEventArgs e) { instance = null; }