C# | Enlarge the Console Application window

Asked

Viewed 501 times

5

How Do I Enlarge the Application Console Window in C#?

I use Visual Studio 2017 Community.

My program will be done in Console Application, I need to change the size of the Console window being generated.

2 answers

4

You can change using Console.SetWindowSize:

 Console.SetWindowSize(60, 100);

You can also set height only Console.WindowHeight or width Console.WindowWidth

Watch out because if you put a larger size than the available will launch you an Exception.

  • Yes, it also worked, I thought it was the pixel drive, but I saw that they are measured by positions. worth.

4

You can use the method Console.Setwindowsize of the Console class to define window dimensions.

        static void Main(string[] args)
        {
            Console.SetWindowSize(10, 5);
            Console.ReadKey();
        }
  • It worked, thank you very much my dear.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.