How to set output console width in Visual Studio

前端 未结 3 1570
无人共我
无人共我 2021-02-13 10:12

Whenever I build and run my C++ code from Visual Studio 2013, the console window width is un-adjustable and because of this, causes my output to be pushed onto the next line soo

3条回答
  •  离开以前
    2021-02-13 11:05

    You can simply use this:

    Console.WindowWidth = Console.LargestWindowWidth - [insert number of pixels from the end of the screen]
    Console.WindowHeight = Console.LargestWindowHeight - [insert number of pixels from the end of the screen]
    

    If I wanted to set the console window to be 15 pixels from the edge of the screen, I would do this:

    Console.WindowWidth = Console.LargestWindowWidth - 15
    

提交回复
热议问题