Is there a way to do this in Windows Phone 7?
I can reference the TextBlock in my C# Code, but I don't know exactly how to then set the foreground color of it.
myTextBlock.Foreground =
//not a clue...
Thanks
Is there a way to do this in Windows Phone 7?
I can reference the TextBlock in my C# Code, but I don't know exactly how to then set the foreground color of it.
myTextBlock.Foreground =
//not a clue...
Thanks
You could use
Brushes.White
to set the foreground.The
Brushes
class is located inSystem.Windows.Media
namespace.Or, you can press Ctrl+. while the cursor is on the unknown class name to automatically add
using
directive.Foreground needs a Brush, so you can use
If you want to use the color from RGB or ARGB then
or
To get the Color from Hex
To get the Color from Hex.
and then set the foreground