To change the background color of text in Console, use the Console.BackgroundColor Property in C#.
Let us now see an example −
using System; class Demo { public static void Main (string[] args) { Console.BackgroundColor = ConsoleColor.Blue; Console.WriteLine("Background color changed = "+Console.BackgroundColor); } }
This will produce the following output −