如何在 VB.NET 的 RichTextBox 中的指定行上追加文本

发布于 2024-09-25 20:55:49 字数 44 浏览 0 评论 0原文

如何在富文本框中附加文本?例如,我需要将其附加到第 40 行第 30 列。

How can I append text in a rich text box? Say, for example, that I need to append it on line 40 at column 30.

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

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

发布评论

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

评论(1

两人的回忆 2024-10-02 20:55:49

取出字符串,计算行数,然后使用字符串操作将字符串手动插入到正确的位置。

您可以通过计算 '\n' 的出现次数来计算行数,对于列,您只需将列号添加到您找到行的位置即可。

如果信息太少,请询问我,我可以为您粘贴 c# 代码。

Take your string, count the lines, then use string manipulation to manually insert your string in the correct position.

You could count lines by counting occurrences of '\n' and for column you just add column number to the position that you find your line at.

If this is too little info, ask me and I can paste you a c# code for it.

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