I want to set the color of my control using a string variable with a value of "blue". Usually you should install it:
Label1.Color = Color.Blue;
But now I want to replace Color.Blue with a value that is in my string variable, for example:
Label1.Color = sColor; // sColor = "Blue"
But I get an error: Cannot convert type 'string' to "System.Drawing.Color"
Any help was appreciated.
source
share