I have a WPF RichTextBox (rtbControl) and the content as following:
This is not an underlined line
This is an underlined line
I want to underline the 2nd line, how can I do it ?
I have a WPF RichTextBox (rtbControl) and the content as following:
This is not an underlined line
This is an underlined line
I want to underline the 2nd line, how can I do it ?
Since RTB
's content is a FlowDocument, then you have to create appropriate document structure:
<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>