private void lblTitle_Click(object sender, EventArgs e)//brings user back to main menu
        {
            frm02MainMenu ma = new frm02MainMenu();

            this.Hide();
            ma.Show();
        }
Beispiel #2
0
        private void LblTitle_Click(object sender, EventArgs e)//loads main menu when clicked
        {
            frm02MainMenu main = new frm02MainMenu();

            this.Hide();
            main.Show();
        }
        private void btnMainMenu_Click_1(object sender, EventArgs e) //when clicked, shows confirmation prompt and (if yes) brings user back to the main menu
        {
            DialogResult exitConfirm = new DialogResult();

            exitConfirm = MessageBox.Show("Are you sure?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

            if (exitConfirm == DialogResult.Yes)
            {
                frm02MainMenu main = new frm02MainMenu();
                this.Hide();
                main.Show();
            }
        }
        private void btnMainMenu_Click(object sender, EventArgs e) //Main menu button
        {
            DialogResult mainConfirm = new DialogResult();

            mainConfirm = MessageBox.Show("Are you sure you want to go to main menu?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

            if (mainConfirm == DialogResult.Yes)
            {
                frm02MainMenu main = new frm02MainMenu();
                this.Hide();
                main.Show();
            }//confirmation dialogue
        }
Beispiel #5
0
        private void btnEnter_Click(object sender, EventArgs e)
        {
            if (txtForname.Text == "" || txtSurname.Text == "") //checks if the user has input both a forename and a surname
            {
                MessageBox.Show("Enter Details", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                attempts++;
                //if either/both details are not entered, displays error and increments "attampts" variable by one
            }
            else
            { //if user inputs correct data, global variables are assigned and the user can log in
                GlobalVars.strForname = txtForname.Text;
                GlobalVars.strSurname = txtSurname.Text;

                frm02MainMenu mainMenu = new frm02MainMenu();
                this.Hide();
                mainMenu.Show();
            }

            if (attempts > 3) //if attempts variables increments over 3 the application closes
            {
                Application.Exit();
            }
        }