0

Подскажите пожалуйста, как изменить цвет курсора в консоли на С#.

1

1 ответ 1

1

В C# вроде нет встроенной функции, которая устанавливает цвет курсора. Он устанавливается неявно, как дополнительный цвет к цвету фона (Console.BackgroundColor). Попробуйте сделать вот так:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace Color
{
    class Program
    {
        static void Main(string[] args)
        {

            ConsoleColor value = ConsoleColor.Blue;
            Console.ForegroundColor = value;
            Console.CursorSize = 100; //Размер курсора 100-макс
            Console.BackgroundColor = ConsoleColor.DarkMagenta; //
            Console.Clear();
            Console.ReadLine();

        }
    }
}

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.