Solved

c# color properties code needed

Posted on 2010-11-11
1
260 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
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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
C# winforms programmitically move panels 6 53
VB.NET 2008 Winforms Signing 13 42
bound data table problem 2 41
Visual Studio hangs on running project 6 61
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

733 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