C# Console WindowHeight
Description
Console WindowHeight
gets or sets the height of the console
window area.
Syntax
Console.WindowHeight
has the following syntax.
public static int WindowHeight { get; set; }
Example
using System;/*from ww w. ja v a2s. co m*/
class Sample
{
public static void Main()
{
int origWidth, width;
int origHeight, height;
origWidth = Console.WindowWidth;
origHeight = Console.WindowHeight;
Console.WriteLine(Console.WindowWidth);
Console.WriteLine(Console.WindowHeight);
Console.WriteLine("Press a key to continue");
Console.ReadKey(true);
width = origWidth/2;
height = origHeight/2;
Console.SetWindowSize(width, height);
Console.WriteLine(Console.WindowWidth);
Console.WriteLine(Console.WindowHeight);
Console.ReadKey(true);
Console.SetWindowSize(origWidth, origHeight);
Console.WriteLine(Console.WindowWidth);
Console.WriteLine(Console.WindowHeight);
}
}