c0D3l0g1c
c0D3l0g1c

Reputation: 3164

Metro App RichEditBox Default ForegroundColor

The WinRT RichEditBox ForegroundColor is Black by default.

How do I change this to a custom color?

This is what I tried...

// Set default ForegroundColor
ITextCharacterFormat defaultCharacterFormat = 
    redBody.Document.GetDefaultCharacterFormat();

defaultCharacterFormat.ForegroundColor = Colors.Blue;

redBody.Document.SetDefaultCharacterFormat(defaultCharacterFormat);
redBody.Document.ApplyDisplayUpdates();

Any ideas on how to get this to work?

Upvotes: 0

Views: 252

Answers (1)

Patrick Finnigan
Patrick Finnigan

Reputation: 1967

If you are using a XAML RichEditBox, then the Foreground property should work for you, e.g. <RichEditBox Foreground="Violet" />.

Upvotes: 1

Related Questions