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);

    }
}




















Home »
  C# Tutorial »
    System »




Array
BitConverter
Boolean
Byte
Char
Console
ConsoleKeyInfo
Convert
DateTime
DateTimeOffset
Decimal
Double
Enum
Environment
Exception
Guid
Int16
Int32
Int64
Math
OperatingSystem
Random
SByte
Single
String
StringComparer
TimeSpan
TimeZone
TimeZoneInfo
Tuple
Tuple
Tuple
Type
UInt16
UInt32
UInt64
Uri
Version