System.Console.SetWindowPosition Method

Sets the position of the console window relative to the screen buffer.

Syntax

public static void SetWindowPosition (int left, int top)

Parameters

left
The column position of the upper left corner of the console window.
top
The row position of the upper left corner of the console window.

Remarks

The operating system window displays the console window, and the console window displays a portion of the screen buffer. The Console.SetWindowPosition(int, int) 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 Console.SetWindowPosition(int, int) method affects the position of the operating system window scroll bars.

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0