- 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 visibility of the Cursor of Console in C#
To change the visibility of the Cursor, use the Console.CursorVisible property.
Example
Let us see an example −
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; class Demo { public static void Main (string[] args) { Console.BackgroundColor = ConsoleColor. Black; Console.WriteLine("Background color changed = "+Console.BackgroundColor); Console.ForegroundColor = ConsoleColor.White; Console.WriteLine("
Foreground color changed = "+Console.ForegroundColor); Console.InputEncoding = Encoding.ASCII; Console.WriteLine("Input Encoding Scheme = "+Console.InputEncoding); Console.OutputEncoding = Encoding.ASCII; Console.WriteLine("Output Encoding Scheme = "+Console.OutputEncoding); Console.CursorVisible = false; Console.Write("
Cursor is Visible? "+ Console.CursorVisible); } }
Output
This will produce the following output −
Advertisements