示例#1
0
 private void newGameNToolStripMenuItem_Click(object sender, EventArgs e)
 {
     beginnerBToolStripMenuItem.Checked     = false;
     intermediateIToolStripMenuItem.Checked = false;
     expertEToolStripMenuItem.Checked       = false;
     settingtoolStripMenuItem.Checked       = false;
     if (sender == beginnerBToolStripMenuItem)
     {
         game.SetGame(9, 9, 10);
         beginnerBToolStripMenuItem.Checked = true;
     }
     else if (sender == intermediateIToolStripMenuItem)
     {
         game.SetGame(16, 16, 40);
         intermediateIToolStripMenuItem.Checked = true;
     }
     else if (sender == expertEToolStripMenuItem)
     {
         game.SetGame(30, 16, 99);
         expertEToolStripMenuItem.Checked = true;
     }
     else if (sender == settingtoolStripMenuItem)
     {
         settingtoolStripMenuItem.Checked = true;
     }
     game.ChangeFormSize(this, menuStripMain.Height, TableLayoutPanelMain.Height);
     game.SetGame();
     labelTime.Text    = "0";                       //時間歸零
     timerMain.Enabled = true;                      //開始計時
     labelMine.Text    = game.mineCount.ToString(); //地雷數量
     this.Refresh();                                //重新繪製
 }