C# Console.WindowHeight Property


The WindowHeight property gets or sets the height of the console window.

Declare a variable.

int height;

Now, get the height of the current window.

height = Console.WindowHeight;

The following is the complete example −

Example

 Live Demo

using System;
using System.Numerics;
using System.Globalization;
class Demo {
   static void Main() {
      int height;
      height = Console.WindowHeight;
      Console.WriteLine("Current window height = "+height);
   }
}

Output

Current window height = 0

Samual Sam
Samual Sam

Learning faster. Every day.

Updated on: 23-Jun-2020

137 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements