0

My question is related to: Change color and font for some part of text in WPF C#

There is an answer that states you can change the text foreground color with this statement:

rangeOfText1.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.Blue);

However, this doesn't work for me: I get a runtime error indicating that the parameter type SolidBrush cannot be used for ForegroundProperty. What's wrong?

Community
  • 1
  • 1
Entwickler582
  • 73
  • 1
  • 7
  • 1
    Possible duplicate of [Change color and font for some part of text in WPF C#](http://stackoverflow.com/questions/5442067/change-color-and-font-for-some-part-of-text-in-wpf-c-sharp) – Naman Apr 14 '16 at 08:56

1 Answers1

3

Use System.Windows.Media.Brushes insted of System.Drawing.Brushes

Noam M
  • 3,156
  • 5
  • 26
  • 41