【发布时间】:2012-04-02 20:58:13
【问题描述】:
我的文本在一个富文本框中:
<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>
我想改变文字的颜色字体和文字颜色:
1- 对于标签 -> 字体名称 = Tahoma , size= 10,color=red
例如:<Parag1 Level="One"> 或 </Parag1>
2- 对于标签级别不是 Footer 的标签之间的文本 -> 字体名称 = Arial , size= 12,color=black
例如:First text of parag1. Second text of parag1. 或 First text of parag4. Second text of parag4.
3- 对于标签级别为 Footer 的标签之间的文本 -> 字体名称 = Microsoft Sans Serif, size= 8,color=blue
例如:First text of parag3. Second text of parag3.
如何在 c# 中做到这一点?(一次更改所有文本的字体!)
【问题讨论】:
-
请不要在您的标题中添加“C#”。这就是标签的用途。
标签: c# richtextbox