C# Console.WindowLeft Property


The WindowsLeft property gets or sets the leftmost position of the console window area relative to the screen buffer.

Declare an integer variable to get the leftmost position.

int left;

Now, use the Console.WindowLeft property.

left = Console.WindowLeft

Let us see the complete example.

Example

 Live Demo

using System;
class Demo {
   static void Main() {
      int left;
      left = Console.WindowLeft;
      Console.WriteLine("Left position of the Console window = "+left);
   }
}

Output

Note: The output may vary accordingly based on the position of the Console Window

Left position of the Console window = 0

Updated on: 23-Jun-2020

148 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements