Gets or sets the background color of the console.
Assembly: mscorlib (in mscorlib.dll)
A change to the property affects only output that is written to individual character cells after the background color is changed. To change the background color of the console window as a whole, set the property and call the Clear method. The following example provides an illustration.
A get operation for a Windows-based application, in which a console does not exist, returns ConsoleColor.Black.
The following example saves the values of the ConsoleColor enumeration to an array and stores the current values of the and ForegroundColor properties to variables. It then changes the foreground color to each color in the ConsoleColor enumeration except to the color that matches the current background, and it changes the background color to each color in the ConsoleColor enumeration except to the color that matches the current foreground. (If the foreground color is the same as the background color, the text isn't visible.) Finally, it calls the ResetColor method to restore the original console colors.
Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.