I am trying to get a hex color using c# in ASp .net with the following code:
System.Windows.Media.Color color = (Color)System.Windows.Media
.ColorConverter
.ConvertFromString("##009999");
Calendar1.BackColor = color;
and I get the following error:
Error 6 Cannot implicitly convert type ‘System.Windows.Media.Color’
to ‘System.Drawing.Color.
Any Help?
In fact on rereading the question again I think this is the answer:
Note that you only want one
#in the input string (so you may need to prune if your input has two).This will give you a
System.Drawing.Colorwhich looks like it is what you want without worrying aboutSystem.Windows.Media.Color