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) -

xcode - Swift Playground - Files are not readable -

jboss7.x - JBoss AS 7.3 vs 7.4 and differences -