例 次の例では、、、WindowWidth、WindowHeight、、BufferWidth、BufferHeightおよびCursorVisibleプロパティ、および 、、SetBufferSizeおよびReadKeyメソッドをSetWindowPosition示WindowLeftWindowTopします。 この例では、画面バッファーの幅に基づいて画面バッファーにグリッド パターンを描画します。 次に、上方向キー、下方向キー、左方向キー、または右方向キーのどちらが押されたかに応じて、コンソール ウィンドウを移動します。 グリッド パターンは、画面バッファーに対するコンソール ウィンドウの動きを確認するのに役立ちます。 // This example demonstrates the Console.WindowLeft and // Console.WindowTop propert
![Console.SetWindowPosition(Int32, Int32) メソッド (System)](https://cdn-ak-scissors.b.st-hatena.com/image/square/d6e4cb632c7025e9f5e05fd314fbf6dcd6144e8d/height=288;version=1;width=512/https%3A%2F%2Flearn.microsoft.com%2Fen-us%2Fmedia%2Fopen-graph-image.png)