Is there a quick way to write boldface text using Console.WriteLine
(C#) or printfn
(F#)?
If not boldface, perhaps some other kind of visual differentiator, like underlined text?
Text = GetMOValue(moDisk, "systemname"); txtType. Text = GetMOValue(moDisk, "MediaType"); txtModel. Text = GetMOValue(moDisk, "Model"); txtFirmware.
WriteLine(String, Object, Object) Writes the text representation of the specified objects, followed by the current line terminator, to the standard output stream using the specified format information.
To print a message to the console, we use the WriteLine method of the Console class. The class represents the standard input, output, and error streams for console applications.
Console. writeline() goes to a console window: the black command / dos prompt.
You can set the Console.ForegroundColor. Click the link, there is a very good example provided in the MSDN.
Fonts and Styles are not available on a per-word basis. To get bold, italics, underline or size, you would have to change all 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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With