Write the text in bold using Console.WriteLine (C #) or printfn (F #)?

Is there a quick way to write bold text using Console.WriteLine (C #) or printfn (F #)?

If not in bold, perhaps some other visual differentiator, such as underlined text?

+8
c # windows f # console
source share
1 answer

You can set Console.ForegroundColor . Click the link; there is a very good example provided on MSDN.

Fonts and styles are not available for each word. To get bold, italic, underline, or size, you have to change all the text in the console.

 Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("Test Text"); Console.ForegroundColor = ConsoleColor.Blue; Console.BackgroundColor = ConsoleColor.White; Console.WriteLine("Test Text 2"); Console.ResetColor(); // To return colors back 
+17
source share

All Articles