Sets the height and width of the screen buffer area to the specified values.
Assembly: mscorlib (in mscorlib.dll)
height or width is less than or equal to zero.
height or width is greater than or equal to Int16.MaxValue.
The user does not have permission to perform this action.
An I/O error occurred.
The following example demonstrates the WindowLeft, WindowTop, WindowWidth, WindowHeight, BufferWidth, BufferHeight, and CursorVisible properties; and the SetWindowPosition, , 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.