Making specific Text Boldefaced in a TextBox

前端 未结 7 1967
情歌与酒
情歌与酒 2020-11-28 12:37

Hi I currently have a texbox that prints out info to the user when they press diffrent buttons. I was wondering if there was a way to make only some of my text bolded while

7条回答
  •  -上瘾入骨i
    2020-11-28 13:15

    A regular TextBox only supports the all or nothing setting of such stylistic properties. You might want to look into RichTextBox, though, you can't just specify a set of values for a Text property in the way you have tried - you will need to work with a FlowDocument to construct your text body through the Document property.

    For an overview of working with a FlowDocument, and some examples, give this a read.

提交回复
热议问题