如何在富文本框左侧显示行号? [英] how to show line numbers on the left of a rich text box?

查看:415
本文介绍了如何在富文本框左侧显示行号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如在komodo编辑器中一样,如何在每行的富文本框左侧显示行号?

How to show line number on the left side of a rich text box in each line as in komodo editor?

推荐答案

据我所知,此组件无法做到这一点.要正确执行此操作,行号不应是文本的一部分,也不应包含在选择内容中,也不应将其复制到剪贴板等.

我看到的所有高级组件都不基于标准Windows类.它们要么基于Control类从头开始制作,要么实现为原始(非托管)Windows窗口,并通过P/Invoke在.NET中使用.

您可以在MonoDevelop的源代码中找到从头开始创建的此类高级编辑器的一个很好的示例,请参见 http://monodevelop.com/ [ ^ ], ^ ].

如果我没有记错的话,最新的MonoDevelop版本的编辑器是在WPF中实现的,但是您也可以在旧版MonoDevelop源代码中找到一个基于Forms的较旧的编辑器.这些编辑器完全独立于MonoDevelop,它们是独立的组件.

—SA
To best of my knowledge, this component is not capable of doing that. To do it right, the line numbers should not be part of text, they should not be included in selection, copied to clipboard, etc.

All the advanced components I saw were not based on standard Windows classes. There are either made from scratch based on the Control class or implemented as a raw (unmanaged) Windows window and used in .NET via P/Invoke.

You can find a good example of such advanced editor created from scratch in the source code of MonoDevelop, see http://monodevelop.com/[^], http://en.wikipedia.org/wiki/MonoDevelop[^].

If I''m not much mistaken, the editor of the latest MonoDevelop version is implemented in WPF, but you can also find an older editor based on Forms in legacy MonoDevelop source code. These editors are totally independent from MonoDevelop, they are separate components.

—SA


这篇关于如何在富文本框左侧显示行号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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