gin*_*ngo 2 .net c# vb.net rtf richtextbox
在.NET项目中,我有一个长文本构建作为几个字符串的串联
StringLongText = text1 + text2 + ... + textN
Run Code Online (Sandbox Code Playgroud)
每个字符串"textX"是评估的结果.在启动过程结束时,我在RichTextBox中显示结果:
rtfTxt.Text = StringLongText
Run Code Online (Sandbox Code Playgroud)
一切正常,但我无法在之前的text1,text2,textN块中添加任何文本格式.
例如,我想在连接它们之前用粗体或斜体写一些单词,包括直接在字符串中的格式.
干
text1 = "This is some {\b bold} text"
rtfTxt.Text = text1
Run Code Online (Sandbox Code Playgroud)
不工作.
有什么建议吗?谢谢您的帮助.
rtfTxt.Rtf = @"{\rtf1\ansi This is some \b bold\b0 text.}";
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
13968 次 |
| 最近记录: |