private void button9_Click(object sender, EventArgs e) { if (MessageBox.Show("LOGOUT APPLICATION?", "CONFIRM", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { this.Hide(); frmSecurity frm = new frmSecurity(); frm.ShowDialog(); } }
private void btnClose_Click(object sender, EventArgs e) { if (dataGridView1.Rows.Count > 0) { MessageBox.Show("UNABLE TO LOGOUT. PLEASE CANCEL THE TRANSACTION", "WARNING", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (MessageBox.Show("LOGOUT APPLICATION?", "LOGOUT", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes) { this.Hide(); frmSecurity frm = new frmSecurity(); frm.ShowDialog(); } }