private void btnBalance_Click(object sender, EventArgs e) { // Creates a new dialog window BalanceForm dlg = new BalanceForm(customer, lstAccounts.SelectedIndex); dlg.ShowDialog(); // Closes the dialog window dlg.Dispose(); }