C# Console.WindowTop Property


The WindowsTop property is used to gets or set the top position of the console window area relative to the screen buffer.

Declare an integer variable to get the top position.

int top;

Now, use the Console.WindowTop property.

top = Console.WindowTop;

Let us see the complete example.

Example

 Live Demo

using System;
class Demo {
   static void Main() {
      int top;
      top = Console.WindowTop;
      Console.WriteLine("Top position of the Console window = "+top);
   }
}

Output

Top position of the Console window = 0

Updated on: 23-Jun-2020

102 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements