How to change the WindowLeft of the Console

CsharpServer Side ProgrammingProgramming

Use the Console.WindowLeft Property to change the WindowLeft of the Console in C#.

Example

Let us now see an example −

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
class Demo {
   public static void Main (string[] args) {
      Console.InputEncoding = Encoding.ASCII;
      Console.WriteLine("Input Encoding Scheme = "+Console.InputEncoding);
      Console.OutputEncoding = Encoding.ASCII;
      Console.WriteLine("Output Encoding Scheme = "+Console.OutputEncoding);
      Console.CursorVisible = false;
      Console.Write("\nCursor is Visible? "+ Console.CursorVisible);
      Console.WindowLeft = 50;
      Console.Write("WindowLeft = "+Console.WindowLeft);
   }
}

Output

This will produce the following output −

Input Encoding Scheme = System.Text.ASCIIEncoding
Output Encoding Scheme = System.Text.ASCIIEncoding
Cursor is Visible? False
WindowLeft = 50
raja
Published on 14-Nov-2019 11:16:37
Advertisements