使用C#在运行时在RichTextBox文本中添加分隔符/行 [英] Adding a Separator/Line in RichTextBox Text on runtime with C#

查看:96
本文介绍了使用C#在运行时在RichTextBox文本中添加分隔符/行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在RichTextbox中输入文本之间的分隔符.就像

richTextBox1.AppendText("From:");
richTextBox1.AppendText("\ n" + strFrom +");
richTextBox1.AppendText("\ nTo:");
richTextBox1.AppendText("\ n" + strTo +");


在这个地方,我想添加一条灰色分隔线以区分标题部分和消息正文中的标题部分


richTextBox1.AppendText("\ n \ n" + strMessageBody +"\ n");



如何使用C#以编程方式添加

I need to enter a separator in RichTextbox between text.. Just Like

richTextBox1.AppendText("From:");
richTextBox1.AppendText("\n" + strFrom + "");
richTextBox1.AppendText("\nTo:");
richTextBox1.AppendText("\n" + strTo + "");


And on this place i want to add a gray separator line to differentiate the header part from the from the Message body


richTextBox1.AppendText("\n\n" + strMessageBody + "\n");



how can i add programmatically using C# ??

推荐答案

位于

以下是有用链接的集合:
C#-通过解析富文本格式在RichTextBox中格式化文本格式(RTF) [如何在RTB中设置字符格式 [在Richtextbox中设置文本格式 [
Here is a collection of useful links:
C# - Formatting Text in a RichTextBox by Parsing the Rich Text Format (RTF)[^]
How to format characters in RTB[^]
format text in richtextbox[^]


这篇关于使用C#在运行时在RichTextBox文本中添加分隔符/行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆