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.
Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.