hey guyz howz u ????
cn u tell me how cn i color my console based output( in C# ) not a whole output but a selected string only.
plz tell me if u knw d answer .......:)
Bye TC
aayush2687
-15
Newbie Poster
Recommended Answers
Jump to PostThis can be done this way:
//Save existing colors ConsoleColor remFG = Console.ForegroundColor; ConsoleColor remBG = Console.BackgroundColor; //Set colors Console.ForegroundColor = ConsoleColor.Black; Console.BackgroundColor = ConsoleColor.Cyan; //Write something Console.Write("This is a string in black, with cyan background"); //Restore colors Console.ForegroundColor = remFG; Console.BackgroundColor = remBG; Console.Write("This will be …
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.