Open In App

Console.MoveBufferArea Method in C#

Console.MoveBufferArea Method is used to move the specified screen area to destination area.

Syntax: public static void MoveBufferArea (int sourceLeft, int sourceTop, int sourceWidth, int sourceHeight, int targetLeft, int targetTop); Parameters: sourceLeft: The leftmost column of the source area. sourceTop: The topmost row of the source area. sourceWidth: The number of columns in the source area. sourceHeight: The number of rows in the source area. targetLeft: The leftmost column of the destination area. targetTop: The topmost row of the destination area.



Exceptions:

Example 1: 






// C# program to print GeeksForGeeks
using System;
 
namespace GFG {
 
class Program {
 
    static void Main(string[] args)
    {
        Console.WriteLine("GeeksForGeeks");
    }
}
}

Output: Example 2: 




// C# program to change area
// of GeeksForGeeks
using System;
 
namespace GFG {
 
class Program {
 
    static void Main(string[] args)
    {
        Console.WriteLine("GeeksForGeeks");
 
        // using the method
        Console.MoveBufferArea(0, 0, Console.BufferWidth,
                           Console.BufferHeight, 10, 10);
    }
}
}

Output: Note:

Reference:


Article Tags :
C#