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