public MainWindow(ChoosingMenu form, int width, int height, int howManyBombs, string difficulty) { //creating window Size = new Size((width * 25) + 80, (height * 25) + 170); Text = "Minesweeper"; //minefield template _positionX = 30; _positionY = 100; _width = width; _height = height; _howManyBombs = howManyBombs; //start button startButton = new Button { Size = new Size(100, 50), Location = new Point((((width * 25) + 80) / 2) - 60, 25), Text = "START" }; startButton.MouseClick += StartButton_MouseClick; Controls.Add(startButton); //after closing window you can choose difficulty again this.form = form; FormClosing += FormClosed; //scoreboard and stopwatch object _difficulty = difficulty; timeBoard = new TimeBoard(); }
public static void Main() { ChoosingMenu choosingMenu = new ChoosingMenu(); Application.Run(choosingMenu); }