Solved

c# color properties code needed

Posted on 2010-11-11
1
230 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 500 total points
Comment Utility
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
This video discusses moving either the default database or any database to a new volume.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

728 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now