programmer_bmb
asked on
Casting From String To Color in C#
Hi to alll ...
I want to save color in regeistry as a text, But how could I convert it to Color object after retreiving the value from regustry ....
the following code doesn't work
Text.BackColor = ((Color)GetValue(....path. ....))
thanks
I want to save color in regeistry as a text, But how could I convert it to Color object after retreiving the value from regustry ....
the following code doesn't work
Text.BackColor = ((Color)GetValue(....path.
thanks
You may include that in a try catch block as an ArgumentException can be thrown if the provided string is not a correct Color
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
String s = "Blue"
Color c = (Color)Enum.Parse(typeof(C