Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
Hello All,
I am beginner to Windows phone Development .
I have defined string as below
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 26-Feb-13 9:12am
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Not for the same string. Strings do not have colors. Smile | :)
 
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
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Solved Myself!

 
Using Run and textBox.Inline.Add()
  Permalink  

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

  Print Answers RSS
0 Maciej Los 295
1 OriginalGriff 278
2 Nguyen.H.H.Dang 230
3 Peter Leow 195
4 arvind mepani 187


Advertise | Privacy | Mobile
Web02 | 2.8.140709.1 | Last Updated 28 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid