title: Create dynamic buttons in a grid layout - Create a magic square UI
body: <p>I'm supposed to create a magic square in 2D using Windows Forms Application. It should look like this:</p>
  
  <p><a href="https://i.stack.imgur.com/JVnHy.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JVnHy.jpg" alt="Image of 3x3 magic Square with numbers and grid shown."></a></p>
  
  <p>However, the user should be able to decide the size of the square (3x3, 5x5, 7x7, etc). I already wrote the code in a Console Application, but I don't know how to add the 2D graphics.</p>
  
  <p>Somebody already asked this question (<a href="https://stackoverflow.com/questions/33817938/how-do-i-put-my-result-into-a-gui">How do I put my result into a GUI?</a>), and one of the answers was to use <code>DataGridView</code>, but I'm not sure if that's what I'm looking for, since I can't make it look like the picture.</p>
  
  <p>Any ideas or advice? </p>