টেক্সটের ফোরগ্রাউন্ড কালার পরিবর্তন করতে, C# এ Console.ForegroundColor প্রপার্টি ব্যবহার করুন।
উদাহরণ
আসুন একটি উদাহরণ দেখি -
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);
}
} আউটপুট
এটি নিম্নলিখিত আউটপুট −
তৈরি করবে
