Is it possible to do selective formatting in a text box i.e. I actually wanted to change the color of mobile numbers in order to the status of DND?
Asked
Active
Viewed 93 times
0
-
Do you mean you want to change color of some text in textbox and not the all? – Microsoft DN Apr 01 '14 at 07:42
-
1possible 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) – Karl-Henrik Apr 01 '14 at 07:47
-
yes but according to the DND status when a user click on a button – user3484018 Apr 01 '14 at 07:47
1 Answers
1
This may be an overkill, but take a look at the RichTextBox class. Here is a nice tutorial.

qqbenq
- 10,220
- 4
- 40
- 45
-
You don't need a `RichTextBox`. Regular `TextBlock` supports formatting of `Inlines`/`Runs`. – Filip Skakun Apr 01 '14 at 09:30
-
-
Right, I missed that... :) Um, uh... it might be useful knowledge if edits are not required. :) – Filip Skakun Apr 01 '14 at 15:55