Exemple #1
0
        private void mainMenuButton_Click(object sender, EventArgs e)
        {
            //Return back to the main screen
            player.PlaySync();

            Form f = this.FindForm();

            f.Controls.Remove(this);
            MainScreen ms = new MainScreen();

            f.Controls.Add(ms);
            ms.Location = new Point((f.Width - ms.Width) / 2, (f.Height - ms.Height) / 2);
            ms.Focus();
        }
        private void exitButton_Click(object sender, EventArgs e)
        {
            SoundPlayer player = new SoundPlayer(Properties.Resources.SelectSound);

            player.PlaySync();

            Form f = this.FindForm();

            f.Controls.Remove(this);
            MainScreen ms = new MainScreen();

            f.Controls.Add(ms);
            ms.Location = new Point((f.Width - ms.Width) / 2, (f.Height - ms.Height) / 2);
            ms.Focus();
        }
        private void exitButton_Click(object sender, EventArgs e)
        {
            player.PlaySync();

            Form1.player1Score = 0;
            Form1.player2Score = 0;

            Form f = this.FindForm();

            f.Controls.Remove(this);
            MainScreen ms = new MainScreen();

            f.Controls.Add(ms);
            ms.Location = new Point((f.Width - ms.Width) / 2, (f.Height - ms.Height) / 2);
            ms.Focus();
        }