我的文本在richtextbox 中:
<Parag1 Level="One">
First text of parag1. Second text of parag1.
</Parag1>
<Parag2 Level="Two">
First text of parag2. Second text of parag2.
</Parag2>
<Parag3 Level="Footer">
First text of parag3. Second text of parag3.
</Parag3>
<Parag4 Level="Three">
First text of parag4. Second text of parag4.
</Parag4>
所有一级、二级、三级标签的字体为 Arial,Size = 9,Color = Red 示例:<Parag1 Level="One">
或</Parag4>
一、二、三级标签之间的文本字体为 MicrosoftNewRomans,大小 = 12,颜色 = 黑色 示例:First text of parag2. Second text of parag2.
具有级别页脚的标签之间的文本字体为 Tahoma,大小 = 10,颜色 = 蓝色示例:First text of parag3. Second text of parag3.
我想在标签 3 和 4 之间添加这一段。示例:
<NewParag5 Level="Footer">
This tags between 3 and 4.
</NewParag5>
问题:如何为段落的单独部分使用相同的字体和颜色。这意味着在不更改其他文本的字体和颜色的情况下,我可以将段落插入richtextbox,然后将标签的字体或颜色更改为红色,将文本更改为蓝色。
请帮助我获取 c# 和 winforms Richtextbox。
谢谢。
问题2:如何在文本之间添加段落,段落部分的字体和颜色设置为标记字体样式和文本保存前样式(字体和颜色)。