Change the Console Foreground and Background color and clear : Console window settings « Development « C# / CSharp Tutorial





using System;

public class MainClass
{
    static void Main(string[] args)
    {
        Console.ForegroundColor = ConsoleColor.Red;
        Console.BackgroundColor = ConsoleColor.Green;
        //Console.Clear();
    }
}










14.8.Console window settings
14.8.1.Change console title
14.8.2.Change the Console Foreground and Background color
14.8.3.Change the Console Foreground and Background color and clear
14.8.4.Reset console color, window size, buffer height and width
14.8.5.Set cursor left, size, top and visible
14.8.6.Clear a Console