合并富文本?

发布于 2024-10-03 18:14:28 字数 184 浏览 0 评论 0原文

我有一个应用程序,涉及逐个字符地构建富文本,以便一次性撤消所有内容。为了保留该字符的格式,我选择它,然后可以将 SelectedRtf 属性添加到我的 StringBuilder,但是我希望能够将每个富文本字符构建到一个富文本字符串中,以便我可以一次性撤消它。

我的问题是如何将富文本字符串组合成一个大字符串,同时保留每个字符的所有格式。

I have an application which involves building rich text character by character in order to undo it all at once. In order to retain that character's formatting, I select it and then can add the SelectedRtf property to my StringBuilder, however I want to be able to build each Rich Text character into one Rich Text string so that I can undo it in one go.

My question is how can you combine Rich Text strings into one big string while retaining all the formatting for each character.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

对风讲故事 2024-10-10 18:14:28

这样合并它:

richTextBox2.Select(richTextBox2.TextLength, 0);
richTextBox2.SelectedRtf = richTextBox1.Rtf;

merge it this way:

richTextBox2.Select(richTextBox2.TextLength, 0);
richTextBox2.SelectedRtf = richTextBox1.Rtf;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文