【发布时间】:2014-10-14 21:43:18
【问题描述】:
我有一个 WPF RichTextBox (rtbControl),内容如下:
这不是下划线
这是下划线
我想在第二行下划线,我该怎么做?
【问题讨论】:
标签: c# wpf richtextbox underline text-formatting
我有一个 WPF RichTextBox (rtbControl),内容如下:
这不是下划线
这是下划线
我想在第二行下划线,我该怎么做?
【问题讨论】:
标签: c# wpf richtextbox underline text-formatting
由于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>
【讨论】:
<RichTextBox>
<FlowDocument>
<Paragraph>
This is not an underline line
</Paragraph>
<Paragraph>
<Underline>This is an underline line</Underline>
</Paragraph>
</FlowDocument>
</RichTextBox>
【讨论】: