Console::BufferWidth Property
Updated: October 2011
Gets or sets the width of the buffer area.
Assembly: mscorlib (in mscorlib.dll)
| Exception | Condition |
|---|---|
| ArgumentOutOfRangeException | The value in a set operation is less than or equal to zero. -or- The value in a set operation is greater than or equal to Int16::MaxValue. -or- The value in a set operation is less than WindowLeft + WindowWidth. |
| SecurityException | The user does not have permission to perform this action. |
| IOException | An I/O error occurred. |
This example demonstrates the BufferHeight and BufferWidth properties. The example reports the dimensions of an operating system window set to a buffer size of 300 rows and 85 columns.
// This example demonstrates the Console.BufferHeight and // Console.BufferWidth properties. using namespace System; int main() { Console::WriteLine( "The current buffer height is {0} rows.", Console::BufferHeight ); Console::WriteLine( "The current buffer width is {0} columns.", Console::BufferWidth ); } /* This example produces the following results: The current buffer height is 300 rows. The current buffer width is 85 columns. */
- UIPermission
for modifying safe top-level windows and subwindows. Associated enumeration: UIPermissionWindow::SafeTopLevelWindows
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
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.