TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
tony turner
NA
4
2.7k
using a Variable to set control properties
Dec 12 2010 5:05 AM
Hi I am wanting to set the border colour of a control depending on a condition at runtime
normally you would set it with the following statement which is fixed
LGB00.BorderBrush = new SolidColorBrush(Colors.Red);
what I would like to do is set the colour depending on which condition is met ie
below is not actual code but what I want to do
string back;
if (x== 1)
back
= Red;
if (x == 2
back
=orange
LGB00.BorderBrush = new SolidColorBrush(Colors.
back
); // somehow use the contents of back to set color
while on the subject of variables is it possible where I have "LGB00.BorderBrush" to us a variable that contains the string rather than the string itself so that i can be used in a loop to change multiple controls.
I'm an old machine code programmer and can do this depending on the syntax choice of imediate, relative, or contents of
( motorola 6809, 68hc11, 68hc05,) tried scoring the net but can't find answer just get plenty of error messages for my effort
cheers tony
Reply
Answers (
3
)
Where does the database live?
How to update listbox after inserting new row