Console.SetWindowSize() Method in C# Last Updated : 06 Jun, 2022 Comments Improve Suggest changes Like Article Like Report Console.SetWindowSize(Int32, Int32) Method is used to change the height and width of the console window to the specified values. Syntax: public static void SetWindowSize (int width, int height); Parameters: width: The width of the console window measured in columns. height: The height of the console window measured in rows. Exceptions: ArgumentOutOfRangeException:If the width or height is less than or equal to zerowidth plus WindowLeft or height plus WindowTop is greater than or equal to MaxValuewidth or height is greater than the largest possible window width or height for the current screen resolution and console font.IOException: If an I/O error occurred. Example 1: Getting the current dimensions of the window. csharp // C# program to get the current // window width and Height using System; namespace GFG { class Program { static void Main(string[] args) { Console.WriteLine(Console.WindowWidth); Console.WriteLine(Console.WindowHeight); } } } Output: Example 2: Setting the value of SetWindowSize csharp // C# program to illustrate the // Console.SetWindowSize Property using System; namespace GFG { class Program { static void Main(string[] args) { // Passed 40, 40 to SetWindowSize to // change window size to 40 by 40 Console.SetWindowSize(40, 40);. // Printing the current dimensions Console.WriteLine(Console.WindowWidth); Console.WriteLine(Console.WindowHeight); } } } Output: Note: See the Horizontal Scroll Bar at the bottom of the Window in both the images. Reference: https://docs.microsoft.com/en-us/dotnet/api/system.console.setwindowsize?view=netframework-4.7.2 Comment More infoAdvertise with us Next Article Console.SetWindowSize() Method in C# S ShivamChauhan5 Follow Improve Article Tags : C# CSharp-method CSharp-Console-Class Similar Reads Console.SetWindowPosition() Method in C# Console.SetWindowPosition(Int32, Int32) Method in C# is used to set the position of the console window relative to the screen buffer. Syntax: public static void SetWindowposition(int left, int top); Parameters: left: It is the column position of the upper left corner of the console window. top: It i 1 min read Console.SetIn() Method in C# The Console.SetIn() method is used to set the In property of the specified StreamReader object i.e. it redirects the standard input from the console to the input file. Since the console is set with this StreamReader object, the ReadLine() method can be called to read the contents of the file, line b 2 min read Console.SetBufferSize() Method in C# 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); Parameters: width: It sets the width of the buffer area measured in the form of columns. height: It sets 2 min read Console.ResetColor() Method in C# Console.ResetColor() Method is used to the foreground and background console colors to their defaults i.e. background to black and foreground to white.Syntax:Â Â public static void ResetColor (); Exceptions:Â Â SecurityException: If the user does not have permissions to perform the action.IOException: 1 min read Console.SetCursorPosition() Method in C# Console.SetCursorPosition(Int32, Int32) Method is used to set the position of cursor. Basically, it specifies where the next write operation will begin in the console window. The window origin changes automatically to make the cursor visible if the specified cursor position is outside the area that 1 min read Like