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
Updated on: 2020-06-23T07:22:58+05:30

213 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements