title: Maximum columns for a Console in C#
body: <p>In a C# console application I have discovered that you can use <code>Console.SetWindowSize(160, 80);</code> to set the size of the console window. This is great, except for the fact that the maximum number of rows and columns is entirely dependent on the display resolution of the person's computer.</p>
  
  <p>When you call <code>Console.SetWindowSize()</code> and supply values that are too high the application throws an error and tells you what the maximum number of columns can be. This maximum number is different depending on your screen resolution. If <code>SetWindowSize()</code> used pixels then getting the max would be easy.</p>
  
  <pre><code>Screen.PrimaryScreen.Bounds.Width
  </code></pre>
  
  <p>However, it doesn't use pixels. It uses columns. Is there any way to determine this max value for the console columns?</p>