- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to change the CursorTop of the Console in C#?
To change the CursorTop of the Console in C#, use the Console.CursorTop property
Example
Let us now see an example −
using System; class Demo { public static void Main (string[] args) { Console.BackgroundColor = ConsoleColor.Blue; Console.WriteLine("Background color changed = "+Console.BackgroundColor); Console.ForegroundColor = ConsoleColor.Yellow; Console.WriteLine("
Foreground color changed = "+Console.ForegroundColor); Console.CursorTop = 20; Console.WriteLine("
CursorTop = "+Console.CursorTop); } }
Output
This will produce the following output −
Advertisements