Console.SetBufferSize(Int32, Int32) Method is used to set the height and width of the screen buffer area to the specified values.
Syntax: public static void SetBufferSize(int width, int height);
width: It sets the width of the buffer area measured in the form of columns.
height: It sets the height of the buffer area measured in the form of rows.
Return value: The new size of the buffer screen.
- ArgumentOutOfRangeException: If the height or width is less than or equal to zero Or height or width is greater than or equal to MaxValue. Also, if the width is less than
WindowLeft + WindowWidthor height is less than
WindowTop + WindowHeightthen we will get the same exception.
- IOException: If an I/O error occurred.
Note: As you will see via the horizontal and the vertical scrollbars in the below examples, as we give different dimensions, we get differently sized windows.
- Difference between Method Overriding and Method Hiding in C#
- C# | IsNullOrEmpty() Method
- C# | Clone() Method
- C# | StartsWith() Method
- Stack.Contains() Method in C#
- C# | Math.Log() Method
- TimeSpan.Add() Method in C#
- Queue.Contains() Method in C#
- C# | CompareOrdinal() Method
- C# | IsNullOrWhiteSpace() Method
- C# | SortedDictionary.Add() Method
- Stack.Pop() Method in C#
- C# | ToCharArray() Method
- DateTime.Add() Method in C#
- C# | Uri.IsWellFormedOriginalString() Method
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.