c# color properties code needed

I have different color skins (Background images) in my application and string named color ie:

string color;

skin_blue
skin_green
skin_red

yes I can do this with an if statement but I would rather do something like this below

BackgroundImage = Properties.Resources.skin+color; Is something like this possible

please can I get the exact code, thanks







crp81Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Carl TawnConnect With a Mentor Systems and Integration DeveloperCommented:
You don't have to use the shorthand version, you can use the expanded version:

    BackgroundImage = Properties.Resources.ResourceManager.GetObject("skin_" + color);
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.