private void btnExit_Click(object sender, EventArgs e)
        {
            DialogResult result = MessageBox.Show("Are you sure you want to exit?", "Exit", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);

            if (result == DialogResult.Yes)
            {
                this.Hide();
                FrmSign_In = new FrmSign_In();
                FrmSign_In.Show();
            }
            else if (result == DialogResult.No)
            {
            }
            else if (result == DialogResult.Cancel)
            {
            }

            /* if (System.Windows.Forms.Application.MessageLoop)
             * {
             *   System.Windows.Forms.Application.Exit();
             * }
             * else
             * {
             *   System.Environment.Exit(1);
             * }*/
        }
Beispiel #2
0
 private void btnCreate_Account_Click(object sender, EventArgs e)
 {
     if (txtFirst_Name.Text == "")
     {
         MessageBox.Show("Please enter your first name.", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
         txtFirst_Name.Focus();
     }
     else if (txtLast_Name.Text == "")
     {
         MessageBox.Show("Please enter your last name.", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
         txtLast_Name.Focus();
     }
     else if (txtId_Number.Text == "")
     {
         MessageBox.Show("Please enter your id number.", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
         txtId_Number.Focus();
     }
     else if (txtEmail_Address.Text == "")
     {
         MessageBox.Show("Please enter your email address.", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
         txtEmail_Address.Focus();
     }
     else if (txtPassword.Text == "")
     {
         MessageBox.Show("Please enter your password.", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
         txtPassword.Focus();
     }
     else if (txtConfirm_Password.Text == "")
     {
         MessageBox.Show("Please enter your password again for confirmation.", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
         txtConfirm_Password.Focus();
     }
     else
     {
         this.Hide();
         FrmSign_In = new FrmSign_In();
         FrmSign_In.Show();
     }
 }