C#C
C#2y ago
21 replies
blackSheep

Resizing the Console window - Console Application

Hi there,

I'm trying to resize the console window in a Console Application. I have tried multiple things and some samples from the MSDN to get this to work but so far didn't manage to get the console to work.
namespace ConsoleApp1
{
    internal class Program
    {
        static void Main(string[] args)
        {
            Console.SetWindowSize(100, 100);
            Console.WriteLine("{0} , {1}",Console.WindowWidth, Console.WindowHeight);
            Console.ReadKey();

            Console.SetWindowSize(50, 50);
            Console.WriteLine("{0} , {1}", Console.WindowWidth, Console.WindowHeight);
        }
    }
}
Was this page helpful?