Click here to Skip to main content
15,896,153 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Hello All,
I am beginner to Windows phone Development .
I have defined string as below
C#
string str = "[Basic settings:] bla bla bla"+
             "[Delete Settings:] bla bla bla"+
             "[Update Settings:] bla bla bla";
//this is a long string in same formate



<TextBlock Name="txtInfo" text="{Binding str}" Foreground="Yellow">

This works fine.All text in a textblock display "Yellow" colored text.
My Question :Is it possible to display a Text in "Red" which is surrounded by square brackets? and remaining in Yellow.
From above Example : [Basic settings:],[Delete Settings:],[Update Settings:] in Red
and all bla, bla ,bla are in Yellow ?

Thanks in advance!
Posted

Not for the same string. Strings do not have colors. :-)

But with a Web application, a work around is way too simple. The nicest work around would be to break the line with some style tags, such as <span class="First">...</span>, <span class="second">...</span>, something like that.

—SA
 
Share this answer
 
v2
Solved Myself!


Using Run and textBox.Inline.Add()
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900