C# Console.Title Example

Console windows have titles. You want to change the title of your console program's window in the C# programming language. By assigning to the Console.Title property, you can change the title text of the window.

This C# program shows the Console.Title property. It changes the title text on a console window.

Console.Title usage

Example

In this example program, we use a while true loop and simply set the Console.Title property to whatever the user typed into the console. When you run this program, you can change the title of the console window by entering text. As you can see, the title can be set to any string value.

Console.ReadLine Tips
Program that uses Console.Title [C#]

using System;

class Program
{
    static void Main()
    {
	while (true)
	{
	    // Assign Console.Title property to string returned by ReadLine.
	    Console.Title = Console.ReadLine();
	}
    }
}

Summary

The C# programming language

Console programs provide a bare-bones but very useful interface for applications. Many programs are targeted to developers, and console applications are perfect for this purpose. The Console.Title property allows to change the console window title, and you can use it to reduce the amount of text written to the screen.

Console Programs
.NET