
- C# Basic Tutorial
- C# - Home
- C# - Overview
- C# - Environment
- C# - Program Structure
- C# - Basic Syntax
- C# - Data Types
- C# - Type Conversion
- C# - Variables
- C# - Constants
- C# - Operators
- C# - Decision Making
- C# - Loops
- C# - Encapsulation
- C# - Methods
- C# - Nullables
- C# - Arrays
- C# - Strings
- C# - Structure
- C# - Enums
- C# - Classes
- C# - Inheritance
- C# - Polymorphism
- C# - Operator Overloading
- C# - Interfaces
- C# - Namespaces
- C# - Preprocessor Directives
- C# - Regular Expressions
- C# - Exception Handling
- C# - File I/O
- C# Advanced Tutorial
- C# - Attributes
- C# - Reflection
- C# - Properties
- C# - Indexers
- C# - Delegates
- C# - Events
- C# - Collections
- C# - Generics
- C# - Anonymous Methods
- C# - Unsafe Codes
- C# - Multithreading
- C# Useful Resources
- C# - Questions and Answers
- C# - Quick Guide
- C# - Useful Resources
- C# - Discussion
How to change the Background Color of Text in C# Console
To change the background color of text in Console, use the Console.BackgroundColor Property in C#.
Example
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); } }
Output
This will produce the following output −
- Related Articles
- How to change the Foreground Color of Text in C# Console?
- How to change background color of canvas-type text using Fabric.js?
- How to change the Foreground color or Font color of the console using PowerShell?
- How to change the background color of the font in PowerShell?
- How to change the background color using jQuery?
- How to change JFrame background color in Java
- How to change axes background color in Matplotlib?
- How to change the background color of a Treeview in Tkinter?
- Change text color based on a brightness of the covered background area in HTML?
- How to change the background color of the options menu in Android?
- How to change the background color of legend in base R plot?
- How to change the background color of ListView items on Android?
- How to change the background color of base R plot region?
- How to change the background color of a tkinter Canvas dynamically?
- How to change header background color of a table in Java

Advertisements