了解 RTF 并使用 vb.net 对其进行编辑 [英] Understanding RTF and edit it with vb.net

查看:49
本文介绍了了解 RTF 并使用 vb.net 对其进行编辑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 vb.net 表单中有这个 RichTextbox,我希望当用户单击按钮时,例如嵌入所选文本,我将如何执行此操作.

I have this RichTextbox in my vb.net form and I would like to when a user click a button, for example to embold the selected text, how would I do this.

此外,我不想使用标准的 vb.net 表达式,例如 RichTextBox1.SelectedText.Font.Bold = True.我想做一些像 RichTextbox1.SelectedRTF="[bold]" &RichTextBox1.SelectedRTF &[/bold]" 或任何 RTF 格式.

Also, I do NOT want to use the standard vb.net expressions such as RichTextBox1.SelectedText.Font.Bold = True. I want to do something like RichTextbox1.SelectedRTF="[bold]" & RichTextBox1.SelectedRTF & "[/bold]" or whatever RTF looks like.

我可以在随机位置添加 RTF 选项吗,或者如果文本格式错误,RichTextBox 是否可以返回错误.我主要是在寻找有关如何在不使用标准 vb 表达式的情况下使用 RTF 的信息.非常感谢您提供的任何帮助

Can I just add the RTF options random places or can a RichTextBox return an error if the text is in wrong format. I'm mostly looking for info on how to work with RTF without using the standard vb expressions. Thank you very much for any help provided

推荐答案

它只是不能这样工作,它不是 HTML 编辑器.通过 Rtf 属性直接破解 RTF 在技术上是可能的,但很难做到正确.RTF 并不是一种友好的格式.开始阅读这里,尽量不要惊慌第一页的质量.好吧,继续吧.

It just doesn't work this way, it is not an HTML editor. Hacking RTF directly is technically possible through the Rtf property but very hard to get right. RTF is not exactly a friendly format. Start reading here, try not to panic at the quality of that first page. Well, go ahead.

这篇关于了解 RTF 并使用 vb.net 对其进行编辑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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