Пример #1
0
        //creating dialog to show the pauseform
        public static DialogResult Show()
        {
            pauseForm = new PauseForm();
            pauseForm.StartPosition = FormStartPosition.CenterScreen;

            pauseForm.ShowDialog();
            return(buttonResult);
        }
Пример #2
0
        public void Pause()
        {
            if (gameTimer.Enabled == true)
            {
                gameTimer.Enabled = false;

                DialogResult dr = PauseForm.Show();

                if (dr == DialogResult.Cancel)
                {
                    gameTimer.Enabled = true;
                }
                else if (dr == DialogResult.Abort)
                {
                    Form       form = this.FindForm();
                    MainScreen ms   = new MainScreen();

                    form.Controls.Add(ms);
                    form.Controls.Remove(this);
                }
            }
        }
Пример #3
0
        public void Pause()
        {
            if (gameTimer.Enabled == true)
            {
                gameTimer.Enabled = false;

                DialogResult dr = PauseForm.Show();

                if (dr == DialogResult.Cancel)
                {
                    gameTimer.Enabled = true;
                }
                else if (dr == DialogResult.Abort)
                {
                    Form       form = this.FindForm();
                    MainScreen ms   = new MainScreen();

                    form.Controls.Add(ms);
                    ms.Location = new Point((form.Width - ms.Width) / 2, (form.Height - ms.Height) / 2);
                    form.Controls.Remove(this);
                }
            }
        }