Take the 2-minute tour ×

I'm trying to set a Console Window as full screen and my current code isn't working Module Module1

Sub Main()
    Console.WindowHeight = Console.LargestWindowHeight
    Console.WindowWidth = Console.LargestWindowWidth
    Console.SetBufferSize(Console.LargestWindowWidth, Console.LargestWindowHeight)
    Console.SetWindowPosition(Console.LargestWindowWidth / 2, Console.LargestWindowHeight / 2)
End Sub

End Module

System.ArgumentOutOfRangeException was unhandled Message=The window position must be set such that the current window size fits within the console's buffer, and the numbers must not be negative.


share|improve this question
Are you sure you're using VBA? System.ArgumentOutOfRangeException sound more like VB.Net to me... –  Treb Nov 30 '12 at 11:51
Oh. Oops. Yeah. It's VB.NET –  Jamie H Nov 30 '12 at 11:52
add comment

1 Answer

up vote 1 down vote accepted

The MSDN gives the answer you seek:

ArgumentOutOfRangeException : left + WindowWidth is greater than BufferWidth. or top + WindowHeight is greater than BufferHeight.

So you should set the window position to 0, 0.

share|improve this answer
Thank you... This worked –  Jamie H Nov 30 '12 at 15:32
add comment

Your Answer


