我有一个WPF RichTextBox(rtbControl),内容如下:
这不是带下划线的线 这是带下划线的
我想强调第二行,我该怎么做?
答案 0 :(得分:2)
由于RTB
的内容是FlowDocument,因此您必须创建适当的文档结构:
<RichTextBox>
<FlowDocument>
<Paragraph>
<Run Text="This is not an underline line"/>
</Paragraph>
<Paragraph>
<Underline>
<Run Text="This is an underline line"/>
</Underline>
</Paragraph>
</FlowDocument>
</RichTextBox>
答案 1 :(得分:-1)
<RichTextBox>
<FlowDocument>
<Paragraph>
This is not an underline line
</Paragraph>
<Paragraph>
<Underline>This is an underline line</Underline>
</Paragraph>
</FlowDocument>
</RichTextBox>