I have created dynamically HyperLink
. And I want to change the color by adding a color code.
HyperLink hpl = new HyperLink();
hpl.Text = "SomeText";
hpl.ForeColor = "#5BB1E6";
//Cannot implicitly convert type 'string' to 'System.Drawing.Color
But I can't.
How to add codes color to ForeColor
?
Is it possible?
Use the following code
HyperLink hpl = new HyperLink();
hpl.Text = "SomeText";
hpl.ForeColor = System.Drawing.ColorTranslator.FromHtml("#5BB1E6");
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