Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

c# color properties code needed

Posted on 2010-11-11
1
Medium Priority
?
274 Views
Last Modified: 2012-08-13
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







0
Comment
Question by:crp81
1 Comment
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 2000 total points
ID: 34118504
You don't have to use the shorthand version, you can use the expanded version:

    BackgroundImage = Properties.Resources.ResourceManager.GetObject("skin_" + color);
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses
Course of the Month10 days, 20 hours left to enroll

886 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question