Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make a part of Stringbuilder content bold?

StringBuilder sb = new StringBuilder();
sb.Append(
        string.Format("{0} |{1} ", Name, Value)
        );
Display.Text = sb.ToString();  // Display is a WP7 TextBlock control 

I want to make "Name" as bold. Is it possible to do that ?

like image 889
Sri Avatar asked Dec 17 '22 07:12

Sri


1 Answers

ChrisF offers the RichTextBox as a solution but its less well known that simple font variation is acheivable with the simple TextBlock:-

myTextBlock.Inlines.Add(new Run() { Text = "Hello " });
myTextBlock.Inlines.Add(new Run() { Text = "World", FontWeight= FontWeights.Bold });
like image 93
AnthonyWJones Avatar answered Dec 25 '22 18:12

AnthonyWJones