private void btnInvoices_Click(object sender, EventArgs e) { if (frmInvoice == null) { frmInvoice = new InvoiceForm(DM, this); } frmInvoice.ShowDialog(); }
/// <summary> /// Creates the Invoice window when the Invoice button is clicked /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnInvoices_Click(object sender, EventArgs e) { if (frmInvoice == null) // Prevents more than one window is created { frmInvoice = new InvoiceForm(DM, this); } frmInvoice.ShowDialog(); // Shows the window }