Gets or sets the width of the console window.
Assembly: mscorlib (in mscorlib.dll)
The value of the property or the value of the WindowHeight property is less than or equal to 0.
The value of the property or the value of the WindowHeight property is greater than the largest possible window width or height for the current screen resolution and console font.
Error reading or writing information.
The example reports the dimensions of a console window set to 85 columns and 43 rows, then waits for a key press. When any key is pressed, the dimensions of the console window are halved, the new dimensions are reported, and the example waits for another key press. Finally, when any key is pressed the console window is restored to its original dimensions and the example terminates.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2