I wrote my code to make Magic Square on a console window, but now I want to display my results in a graphical interface. Like this:

Basically, I'm trying to add 2D graphics to the magic square code that I wrote. So that the numbers and the grid are shown as the image above.
How can I do it? I am not familiar with the GUI yet. Any tips or suggestions on how to get this code started?
This is my code for the magic square that I wrote for the console window:
int n = 0; // initializing to zero Console.WriteLine("\t\t\t\t~Magic Square~\n"); Console.Write("Enter an Odd Number for the Magic Square: "); n = Convert.ToInt32(Console.ReadLine()); // users' input for "n" Console.WriteLine(""); // space int squareSizeN = n * n; int row = 0; int column = (n / 2); int[,] magicSquare = new int[n, n]; // [rows, columns] for (int i = 1; i <= squareSizeN; i++) { magicSquare[row, column] = i; row--; column++; if (i % n == 0) { row += 2; column -= 1; } else { column = (column + n) % n; row = (row + n) % n; } } for (int j = 0; j < n; j++) { for (int k = 0; k < n; k++) { Console.Write(Convert.ToString(magicSquare[j,k]).PadLeft((Convert.ToString(squareSizeN).Length), ' ') + " "); } Console.WriteLine("\n"); }
source share