Getting the Largest Window Height and Width of the Console in C#

CsharpServer Side ProgrammingProgramming

To get the largest window height of the Console, the code is as follows −

Example

 Live Demo

using System;
public class Demo{
   public static void Main(string[] args){
      Console.WriteLine("Largest Window Height of the Console = "+Console.LargestWindowHeight);
   }
}

Output

This will produce the following output −

Largest Window Height of the Console = 58

Example

To get the largest window width of the Console, the code is as follows −

 Live Demo

using System;
public class Demo{
   public static void Main(string[] args){
      Console.WriteLine("Largest Window Width of the Console = "+Console.LargestWindowWidth);
   }
}

Output

This will produce the following output −

Largest Window Width of the Console = 190
raja
Published on 11-Dec-2019 05:56:27
Advertisements