Sets the position of the console window relative to the screen buffer.
Assembly: mscorlib (in mscorlib.dll)
The operating system window displays the console window, and the console window displays a portion of the screen buffer. The method affects the position of the console window relative to the screen buffer, but does not affect the position of the operating system window relative to the desktop.
The console and operating system windows generally do not affect each other. However, if the screen buffer cannot be displayed in the current boundaries of the console window, the operating system automatically appends scroll bars to the operating system window. In that case, moving the operating system window scroll bars affects the position of the console window, and moving the console window with the method affects the position of the operating system window scroll bars.
The following example demonstrates the WindowLeft, WindowTop, WindowWidth, WindowHeight, BufferWidth, BufferHeight, and CursorVisible properties; and the , SetBufferSize, and ReadKey methods. The example draws a grid pattern in the screen buffer based on the screen buffer width. Then the example moves the console window in response to which of the UP ARROW, DOWN ARROW, LEFT ARROW, or RIGHT ARROW console keys is pressed. The grid pattern helps you see the movement of the console window relative to the screen buffer.