How to convert color to string and color to string
I saw a problem in the forum just now. The type "System. Drawing. Color" cannot be implicitly converted to "string ":
This problem will occur when developing website applications to json serialization. In fact, this question has already been answered in MSDN. Take a look at the following method:
For more details, see TypeConverter Class http://msdn.microsoft.com/en-us/library/system.componentmodel.typeconverter (v = vs.110). aspx
How to convert strings and colors in c #
String c1 = System. Drawing. ColorTranslator. ToHtml (System. Drawing. Color. Red );
// C1 = "# ff0000"; or c1 = "Red ";
System. Drawing. Color c2 = System. Drawing. ColorTranslator. FromHtml ("# ff0000 ");
How to change the character color in word
"All characters "?
Ctrl + H
Search content: ^?
Replace with: click "advanced"-format-font color-select "blue"-OK-replace all
"All numbers ":
^? Change to ^ #