private void btnClose_Click(object sender, EventArgs e) { DialogResult close; close = MessageBox.Show("Do you want to make a payment?", "Payment Request", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (close == DialogResult.Yes) { Pay payment = new Pay(); payment.ShowDialog(this); } else { this.Close(); } }
private void paymentToolStripMenuItem_Click(object sender, EventArgs e) {//Define new payment form Pay payment = new Pay(); payment.ShowDialog(this); }