/// <summary> /// Displays a TotalsForm if buttonTotals clicked /// </summary> /// <param name="sender">the control/object to set</param> /// <param name="e">the event data to set</param> private void buttonTotals_Click(object sender, EventArgs e) { TotalsDialog dlg = TotalsDialog.CreateForm(); dlg.Show(); dlg.Activate(); }
/// <summary> /// Method to create a TotalsDialog Form /// </summary> /// <returns>instance</returns> public static TotalsDialog CreateForm() // create public static method with form type return { if (instance == null) { instance = new TotalsDialog(); } return(instance); }
/// <summary> /// Method to make instance of form to null upon closing /// </summary> /// <param name="sender">the control/object to set</param> /// <param name="e">the event data to set</param> private void TotalsDialog_FormClosing(object sender, FormClosingEventArgs e) { instance = null; }