Пример #1
0
        //Closes the current Form and open the home screen.
        private void goBack()
        {
            this.Hide();
            frmLoginScreen login = new frmLoginScreen();

            login.ShowDialog();
            this.Close();
        }
Пример #2
0
        //Goes to the previous form (Login)
        private void btnBack_Click(object sender, EventArgs e)
        {
            DialogResult dialogResult = MessageBox.Show("Are you sure you want to go back without saving?", "Go back", MessageBoxButtons.YesNo);

            if (dialogResult == DialogResult.Yes)
            {
                this.Hide();
                frmLoginScreen login = new frmLoginScreen();
                login.ShowDialog();
                this.Close();
            }
            else if (dialogResult == DialogResult.No)
            {
                //do nothing
            }
        }