// This function including necessary procedures of new game load. private void SetGame() { GameBoard.Visible = true; textBox1.Visible = false; GameBoard.Controls.Clear(); theController.InitGameData(); this.GameBoardDisplay(); this.GameValueDisplay(theController.sudokuString); SetClicks(); Mytime.Start(); Mytime.Tag = "Open"; timeTicks = 0; theController.ClearSteps(); }
//--------- game button functions ------- // Pause the game by menu bar. private void PauseToolStripMenuItem_Click(object sender, EventArgs e) { if (gameSelect != null && gameSelect != "") { if ((string)Mytime.Tag == "Open") { Mytime.Stop(); Mytime.Tag = "Close"; GameBoard.Visible = false; PauseButton.Text = "Continue"; pauseToolStripMenuItem.Text = "Continue"; } else { Mytime.Start(); Mytime.Tag = "Open"; GameBoard.Visible = true; PauseButton.Text = "Pause"; pauseToolStripMenuItem.Text = "Pause"; } } }