System.WindowsConsoleDriver.SetWindowSize C# (CSharp) Method

SetWindowSize() public method

public SetWindowSize ( int width, int height ) : void
width int
height int
return void
		public void SetWindowSize (int width, int height)
		{
			ConsoleScreenBufferInfo info = new ConsoleScreenBufferInfo ();
			GetConsoleScreenBufferInfo (outputHandle, out info);
			SmallRect rect = info.Window;
			rect.Right = (short) (rect.Left + width - 1);
			rect.Bottom = (short) (rect.Top + height - 1);
			if (!SetConsoleWindowInfo (outputHandle, true, ref rect))
				throw new ArgumentOutOfRangeException ("left/top", "Windows error " + Marshal.GetLastWin32Error ());
		}