0

I am trying to change the color of some words inside a text box in WPF, at run-time, like text editors do, to highlight predefined keywords, such as While.

Any help would be appreciated, Thanks in advance.

Aram
  • 29
  • 3
  • 2
    Possible duplicate of [Change color and font for some part of text in WPF C#](https://stackoverflow.com/questions/5442067/change-color-and-font-for-some-part-of-text-in-wpf-c-sharp) – dhilmathy Jul 16 '18 at 14:08

1 Answers1

-1

you could use the foreground property to set the new color like say after pressing a button

TextBoxName.Foreground = new SolidBrushcolor(colors.Blue);
Josef
  • 2,869
  • 2
  • 22
  • 23