- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Console.ResetColor() Method in C#
The Console.ResetColor() method in C# is used to set the foreground and background console colors to their defaults.
Syntax
The syntax is as follows −
public static void ResetColor ();
Example
Let us now see an example to implement the Console.ResetColor() method in C# −
using System; class Demo { public static void Main (string[] args) { Console.WriteLine ("At first, we have set colors here...
After that, we will reset the colors to default."); Console.BackgroundColor = ConsoleColor.White; Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine ("
Colors are set for this text"); Console.ResetColor(); Console.WriteLine ("
Now we reset the color to default!"); } }
Output
This will produce the following output −
Advertisements