Console.SetCursorPosition(Int32, Int32) Method is used to set the position of cursor. Basically, it specifies where the next write operation will begin in the console window. The window origin changes automatically to make the cursor visible if the specified cursor position is outside the area that is currently visible in the console window.
Syntax: public static void SetCursorposition(int left, int top);
left: It is the column position of the cursor. Columns are numbered from left to right starting at 0.
top: It is the row position of the cursor. Rows are numbered from top to bottom starting at 0.
- ArgumentOutOfRangeException: If the left or top is less than 0 or left >= BufferWidth or top >= BufferHeight.
- SecurityException: If the user doesn’t have the permission to perform this action.
When Console.SetCursorPosition() method is not used:
- Difference between Method Overriding and Method Hiding in C#
- jQuery | off() Method
- C# | PadLeft() Method
- C# | Math.Abs() Method | Set - 2
- Extension Method in C#
- Stack.Contains() Method in C#
- C# | Math.Pow() Method
- C# | Math.Abs() Method | Set - 1
- Stack.Pop() Method in C#
- C# | Join() Method | Set - 1
- C# | Method Parameters
- C# | Trim() Method
- C# | ToCharArray() Method
- Method Hiding in C#
- C# | Math.Exp() Method
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.