

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- 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("\nForeground 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("\nCursor is Visible? "+ Console.CursorVisible); } }
Output
This will produce the following output −
- Related Questions & Answers
- How to change the WindowLeft of the Console
- How to change the CursorLeft of the Console in C#?
- How to change the CursorSize of the Console in C#?
- How to change the CursorTop of the Console in C#?
- How to change the WindowHeight of the Console in C#?
- How to change the WindowTop of the Console in C#?
- How to change the WindowWidth of the Console in C#?
- How to change BufferWidth of the Console in C#?
- How to change BufferHeight of the Console in C#?
- How to change the size of the Console using PowerShell?
- How to change the Input Encoding Scheme of the C# Console?
- How to change the Output Encoding Scheme of the C# Console?
- How to change the Title of the console using PowerShell command?
- How to change the Foreground Color of Text in C# Console?
- How to change the Background Color of Text in C# Console
Advertisements