I'm currently trying to change the background color of an array, specifically in this case, grid[0, 0]. I've searched around for a while and can't seem to come up with anything. It's probably quite a simple problem, or maybe I need a break!
Console.BackgroundColor(grid[0,0]) = ConsoleColor.Cyan;
I'm trying to make the background colour Cyan. The variable is a string and contains a space.
Cheers in advance.
FULL SOURCE:
static void Main(string[] args)
{
Console.CursorSize = 100;
int row, col;
string[,] grid = new string[10, 10];
for (col = 0; col < 10; col++)
{
for (row = 0; row < 10; row++)
{
grid[col, row] = " ";
}
}
for (col = 0; col < 10; col++)
{
for (row = 0; row < 10; row++)
{
Console.Write(grid[col, row]);
}
Console.Write("\n");
}
Console.BackgroundColor(grid[0,0]) = ConsoleColor.Cyan;
Console.ReadKey();
}