问题
Ive searched the Web, but i cant seem to find the solution. I want my whole console application window to be a specific color, for example blue. How do I do that?
回答1:
Simply set the background color and call Console.Clear()
:
class Program {
static void Main(string[] args) {
Console.BackgroundColor = ConsoleColor.Blue;
Console.Clear();
Console.ForegroundColor = ConsoleColor.White;
Console.Write("Press any key to continue");
Console.ReadKey();
}
}

回答2:
You can set Console.BackgroundColor property to ConsoleColor enumeration..
Gets or sets the background color of the console. To change the background color of the > console window as a whole, set the BackgroundColor property and call the
Clear
method.
Console.BackgroundColor = ConsoleColor.Blue;
Console.Clear();

And you can use Console.ForegroundColor property for
Gets or sets the foreground color of the console.
Console.ForegroundColor = ConsoleColor.Blue;

回答3:
The OP question was asking for how to set the entire background color to blue. None of the other samples shows this correctly. Here's how:
namespace ClearConsole
{
class Program
{
static void Main(string[] args)
{
Console.BackgroundColor = ConsoleColor.Blue;
Console.Clear();
}
}
}
回答4:
Console.ForegroundColor = Color.Blue;
Console.WriteLine("This string is blue!");
来源:https://stackoverflow.com/questions/14792066/change-background-color-on-c-sharp-console-application