How to increase the size of the console window in C#?

后端 未结 1 1718
别那么骄傲
别那么骄傲 2021-01-18 19:54

I\'m creating a prototype for a piece of functionality that I will be implementing in an application, specifically I am displaying data from a collection to the console wind

相关标签:
1条回答
  • 2021-01-18 20:23

    No programming is required. Create a shortcut to your program on the desktop. Right-click it, Properties, Layout tab. Adjust the Width property of the screen buffer and window size.

    But you can do it programmatically too, those Windows API functions you found are wrapped by the Console class as well. For example:

        static void Main(string[] args) {
            Console.BufferWidth = 100;
            Console.SetWindowSize(Console.BufferWidth, 25);
            Console.ReadLine();
        }
    
    0 讨论(0)
提交回复
热议问题