Để thay đổi CursorSize của Console trong C #, hãy sử dụng thuộc tính Console.CursorSize trong C #.
Ví dụ
Hãy để chúng tôi xem một ví dụ -
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("\nForeground color changed = "+Console.ForegroundColor);
Console.CursorSize = 1;
Console.WriteLine("\nCursorSize = "+Console.CursorSize);
}
} Đầu ra
Điều này sẽ tạo ra kết quả sau -