private void Panel1Board_Paint(object sender, PaintEventArgs e) { pGraphics = panel1Board.CreateGraphics(); gEngine = new GFX(pGraphics, Convert.ToInt32(numUD_Board.Value)); board = new Board(Convert.ToInt32(numUD_Board.Value)); }