

StringBuilder sbG2 = new StringBuilder() StringBuilder sbG1 = new StringBuilder() String m1 = "1) Press the cursor keys to move the console window.\n" + This example demonstrates the Console.WindowLeft and This example produces results similar to the following:ġ) Press the cursor keys to move the console window.Ģ) Press any key to begin. SbG2->Append( g2, 0, Console::BufferWidth % g2->Length ) Ĭonsole::SetWindowPosition( Console::WindowLeft - 1, Console::WindowTop ) Ĭonsole::SetWindowPosition( Console::WindowLeft, Console::WindowTop - 1 ) Ĭonsole::SetBufferSize( saveBufferWidth, saveBufferHeight ) Ĭonsole::SetWindowSize( saveWindowWidth, saveWindowHeight ) Ĭonsole::CursorVisible = saveCursorVisible SbG1->Append( g1, 0, Console::BufferWidth % g1->Length ) this same technique could be used with an arbitrary buffer width.) Set the smallest possible window size before setting the buffer size. SaveCursorVisible = Console::CursorVisible SaveWindowHeight = Console::WindowHeight SaveBufferHeight = Console::BufferHeight StringBuilder^ sbG2 = gcnew StringBuilder StringBuilder^ sbG1 = gcnew StringBuilder String^ m1 = "1) Press the cursor keys to move the console window.\n" The grid pattern helps you see the movement of the console window relative to the screen buffer. Then the example moves the console window in response to which of the UP ARROW, DOWN ARROW, LEFT ARROW, or RIGHT ARROW console keys is pressed. The example draws a grid pattern in the screen buffer based on the screen buffer width. The following example demonstrates the WindowLeft, WindowTop, WindowWidth, WindowHeight, BufferWidth, BufferHeight, and CursorVisible properties and the SetWindowPosition, SetBufferSize, and ReadKey methods. The set operation is invoked on an operating system other than Windows.
