Cannot implicitly convert type ‘string’ to ‘System.Drawing.Color’ (암시적으로 ‘string’ 형식을 ‘System.Drawing.Color’ 형식으로 변환할 수 없습니다.)

Print Friendly, PDF & Email

출처(Original Post) : http://www.akxl.net/labs/articles/converting-a-hexadecimal-color-to-a-system.drawing.color-object/

When using C#, Converting Hex Value Color to System.Drawing.Color is really inconvenient.
Anyway, you can use below syntax .
Do not use “using System.Drawing.Color;”
Because, there are no such namespace. :-)


System.Drawing.Color myOrangeColor= System.Drawing.ColorTranslator.FromHtml("#CE560C");
someLink.ForeColor=myOrangeColor;

For Example,
someLink.ForeColor=”#000000″; causes Error.
You can use,

someLink.ForeColor=myOrangeColor;

One thought on “Cannot implicitly convert type ‘string’ to ‘System.Drawing.Color’ (암시적으로 ‘string’ 형식을 ‘System.Drawing.Color’ 형식으로 변환할 수 없습니다.)

Leave a Reply

Your email address will not be published. Required fields are marked *