c# - Change color in part of text in textblock -


i need change color in code behind part of text string..

my exaple:

textblock1.text = string1 + string2 + string3; 

string have dynamic values, , want string2 display after running program in blue color , must defined in code behind.

its possible? thank you!

that working

                        textblock1.inlines.clear();                         textblock1.inlines.add(new run(string1));                         textblock1.inlines.add(new run(string2) { foreground = brushes.blue }); 

Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -