IntroductionThis article will teach you about how you can control the appearance of the console application like background color of the console screen, forecolor of screen, size of the screen title of the screen. TechnologyC#, .NET 2.0/3.5/4.0 ImplementationYou can control the appearance of the console screen using the System.Console Class's static properties. Code Snippet namespace ConsoleAppearance
{class Program
{static void Main(string[] args)
{//Changing the Title of ConsoleConsole.Title = "Test Console ..";//Changing The Foregroud of Console"Console.ForegroundColor = ConsoleColor.Cyan;
Console.WriteLine("Console foregound color ");//Setting Window SizeConsole.SetWindowSize(100, 50);//Changing the Back gound colorConsole.BackgroundColor = ConsoleColor.DarkGray;
Console.ForegroundColor = ConsoleColor.DarkRed;
Console.WriteLine("Testing back +fore color ");
Console.ReadKey();
}
}
}ConclusionWe have just seen in the article about how to control the appearance of the Console Window. Sample Project SourceDownload source files -16 kb |