C# Console SetWindowSize
Description
Console SetWindowSize
sets the height and width of the
console window to the specified values.
Syntax
Console.SetWindowSize
has the following syntax.
public static void SetWindowSize(
int width,
int height
)
Parameters
Console.SetWindowSize
has the following parameters.
width
- The width of the console window measured in columns.height
- The height of the console window measured in rows.
Returns
Console.SetWindowSize
method returns
Example
This example demonstrates the Console.SetWindowSize method.
/* w w w . j a v a 2s.c om*/
using System;
class Sample
{
public static void Main()
{
Console.SetWindowSize(40, 40);
Console.WriteLine(Console.WindowWidth);
Console.WriteLine(Console.WindowHeight);
}
}