Programmatically setting the background colour of an element in Windows 8

If you find yourself wanting to set the colour an element in windows 8 with C#, it might not be all that obvious.

So here is a simple code snippet does just that.

MyElement.Background = new SolidColorBrush(Color.FromArgb(255, 123, 183, 42));

Fairly straight forward, you can get RGB values from any decent design program.


Published by

Alan Feekery

Developer, Gamer, Musician, Cyclist and big Motorsport fan... enjoys the odd cup of coffee :)

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s