How can I change the width of a Windows console window?

前端 未结 11 2244
一向
一向 2020-12-05 07:06

Is it possible to programmatically, or otherwise, increase the width of the Windows console window? Or do I need to create a wrapper program that looks and acts like the con

11条回答
  •  忘掉有多难
    2020-12-05 07:46

    If you're programming C# here's a method that worked for me (from the bottom of this page)

    static void setConsoleSize()
       {
           System.Console.SetWindowPosition(0,0);   // sets window position to upper left
           System.Console.SetBufferSize(200,300);   // make sure buffer is bigger than window
           System.Console.SetWindowSize(122,54);   //set window size to almost full screen 
           //width - maxSet(127,57) (width, height)
    
           //System.Console.ResetColor(); //resets fore and background colors to default
    
       }  // End  setConsoleSize()
    

    Quoted from the post: "My maximum console size that I could use was 127 columns and 57 rows because that's all that my screen resolution will allow. Reset your screen resolution and this will change.

    This is just one of those things that you are going to have to play around with in order for you to get it to display as you like. "

提交回复
热议问题