Gets or sets the top position of the console window area relative to the screen buffer.
Assembly: mscorlib (in mscorlib.dll)
The console represents a rectangular window into a larger rectangular buffer area. Both the window and the buffer are measured vertically by their number of rows and horizontally by their number of columns. The dimensions of the buffer area are defined by the BufferHeight and BufferWidth properties. The dimensions of the console area are defined by the WindowHeight and WindowWidth properties. The property determines which row of the buffer area is displayed in the first column of the console window. The value of the property can range from 0 to BufferHeight - WindowHeight. Attempting to set it to a value outside that range throws an ArgumentOutOfRangeException.
The following example demonstrates the WindowLeft, , WindowWidth, WindowHeight, BufferWidth, BufferHeight, and CursorVisible properties; and the SetWindowPosition, 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.