Console.BackgroundColor method in C#

In this article, I will explain you about Console.BackgroundColor method in C#.
  • 4113

Introduction

Console applications are run on a black and white screen. We can change the background and foreground color of a console application. This makes program easier to use and more expressive. Console.BackgroundColor method is used to change the background color of text on console window. We can also define the important information.

Example

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

namespace ConsoleApplication11

{

    class Program

    {

        static void Main()

        {

            Console.BackgroundColor = ConsoleColor.Blue;

            Console.WriteLine("*Uma*****************");

            Console.WriteLine(" *is ");

            Console.WriteLine("  *a");

            Console.WriteLine("   *very");

            Console.WriteLine("    *beautiful");

            Console.WriteLine("     Girl*********************");

            Console.ReadLine();

 

        }

    }

}

The output of above program

 Clipboard215.jpg 

© 2013 dotNetheaven. All rights reserved.