private void btnLogout_Click(object sender, EventArgs e) { if (MessageBox.Show("Do you realy want to Logout?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { this.Hide(); frmSecurity frm = new frmSecurity(); frm.ShowDialog(); } }
private void btnCloseMainForm_Click(object sender, EventArgs e) { if (MessageBox.Show("Are you sure to Exit?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { this.Hide(); frmSecurity frm = new frmSecurity(); frm.ShowDialog(); } }
private void btnExit_Click(object sender, EventArgs e) { if (dataGridSale.Rows.Count > 0) { MessageBox.Show("Unable to logout, Please cancel the transection.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } if (MessageBox.Show("logout Application?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { this.Hide(); frmSecurity frm = new frmSecurity(); frm.ShowDialog(); } }