SetWindowSize() Method in C# 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.
The size of a screen buffer is expressed in terms of a coordinate grid based on character cells. The width is the number of character cells in each row, and the height is the number of rows.
Simply run "mode cols,lines" to change the size of the current console window:
mode 120,60
will resize the console window to 120 columns and 60 lines
You can increase it manually by right-clicking the tray icon and entering the options dialog.
There are also third-party terminal emulators for Windows, such as Console:
system("mode 45, 20");
This is a bad solution because it disables vertical scrolling.
This is better:
system("mode CON: COLS=120");
There is a window's api function to set the width. Here's a tut on it. http://www.adrianxw.dk/SoftwareSite/Consoles/Consoles6.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With