public void NewGame() { while (this.Controls.Count > 0) { this.Controls[0].Dispose(); } Refresh(); InitializeComponent(); Game = new Minesweeper(this); this.label1.Text = "Mines: " + Game.MineSweeperSizes[Game.Dificulty][0]; }
public Form1() { this.ClientSize = new System.Drawing.Size(800, 570); this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F); /* * this.SetStyle(ControlStyles.SupportsTransparentBackColor | * ControlStyles.AllPaintingInWmPaint | * ControlStyles.UserPaint | * ControlStyles.DoubleBuffer, true); */ InitializeComponent(); Game = new Minesweeper(this); this.label1.Text = "Mines: " + Game.MineSweeperSizes[Game.Dificulty][0]; this.Resize += ResizeButtons; }