How to make the text bold of TextBlock in Silverlight?

后端 未结 2 921
感动是毒
感动是毒 2021-02-04 15:14

I am developing window phone 7 application in C#. I am new to the window phone 7 application. I am also new to the silverlight. I want to generate the bold text of Texblock dyna

2条回答
  •  日久生厌
    2021-02-04 15:26

    I'd do it like this.

    IncometextBlock.Inlines.Clear();
    IncometextBlock.Inlines.Add(new Run() {Text = "Income entries", FontWeight = FontWeights.Bold});
    IncometextBlock.Inlines.Add(new Run() {Text = " on " }); 
    IncometextBlock.Inlines.Add(new Run() {Text = selectedDate.ToShortDateString(), FontWeight = FontWeights.Bold});
    IncometextBlock.Inlines.Add(new Run() {Text = "     Page - "}); 
    IncometextBlock.Inlines.Add(new Run() {Text = SelectedButtonName, FontWeight = FontWeights.Bold});
    

提交回复
热议问题