精通
英语
和
开源
,
擅长
开发
与
培训
,
胸怀四海
第一信赖
锐英源精品开源心得,转载请注明:“锐英源www.wisestudy.cn,孙老师作品,电话13803810136。”需要全文内容也请联系孙老师。
About two years ago I was creating a project for university. It was a complex of five programs that were related to testing (checking knowledge I mean). One of them contained a text editor. But unfortunately, I didn't know how to do that, that's why it was very simple. So, after these two years, I decided to rewrite my program in C# .NET (initially, it was written in VB.NET) and create a new powerful text editor. You can see part of it here.
大约两年前,我为大学创建一个项目。这是一个复杂五项目体,内部有相关测试(我的意思检查知识)。其中一个包含一个文本编辑器。但不幸的是,我不知道怎么做,这就是为什么它是非常简单的。所以,这两年之后,我决定在c#中重写我的程序(最初是用VB.NET),并创建一个新的强大的文本编辑器。你可以在这里看到它的一部分。
I spent a lot of time(!) searching the Internet for controls like this, but the best ones are shareware and others did not fit my needs. So, what does this control have? I tried to make it look like Microsoft Word and I think that there are some similarities. The ruler lets you change the following: left and right margins, left indent, hanging indent and right indent. You also can disable margins (their values are set to 1). You can see how it looks in the picture above.
我花了很多时间(!)在互联网搜索这样的控件,但最好的是共享软件并且其他的不符合我的需求。因此,这是什么控件呢?我试图让它看起来像Microsoft Word,我觉得有一些相似之处标尺允许您更改以下内容:左,右页边距,左缩进,悬挂缩进和右缩进。你也可以禁用边距(它们的值设置为1),在上图中你可以看到它的外观。
Also, you can add tabs by clicking on the control with the left mouse button. But it is allowed only inside the area bounded by margins. If you want to remove a tab, just drag it off from the control. 此外,您可以通过鼠标左键点击控件添加标签,但这只允许在边距限定的范围内。如果你想要删除一个标签,只需从控件中将它拖出。
The editor lets you use lists, underline styles, advanced char styles (you can create your own links, that are not words starting with "http://" or even "www"), OLE functionality is also available. I want to thank Oscar Londoño for his article Inserting Images into a RichTextBox Control (The OLE Way). It helped me a lot to deal with OLE. This project contains his code.
编辑器允许您使用列表,下划线风格,先进的字符样式(您可以创建自己的链接,而不是通过开始前缀“http://”甚至“www”),OLE功能也可以。我要感谢奥斯卡·隆多尼奥在RichTextBox控件中插入图片(OLE方式)。它帮助我很多。这个项目包含他的代码。
You can use the code according to the CPOL.您可以根据CPOL使用代码。
Projects are created as Windows Applications, but you can easily convert them into *.dll or just embed code into your project.
项目创建为Windows应用程序,但是您可以很容易地将其转换成*.dll或者只是将代码嵌入到您的项目中。
Unfortunately, I removed Visual Studio 2005, so, sorry but I can't create and upload a Visual Studio 2005 project. But you can import all required files into a Visual Studio 2005 project without any problems. However, note that Visual Studio 2008 added some new namespaces (like LINQ) that Visual Studio 2005 does not "understand". Just remove them. That's all. You are ready.
不幸的是,我删除了Visual Studio2005,那么,抱歉,我不能创建并上传一个Visual Studio 2005项目。但是你可以导入所需的所有文件到一个没有错误的Visual Studio 2005中的。然而,请注意,Visual Studio 2008中添加了一些新的名称空间(比如LINQ),Visual Studio 2005不能“理解”。只要删除它们就可以了。
One thing that shocked me is that Microsoft has released RichTextBox 6.0! (It is distributed with Microsoft Office 2007) but... with one exception. There is no documentation about its features. All that I've found is a list of added functions. You can find it here. There are also descriptions for all released versions of RichTextBox.
让我震惊的一件事是,微软已经发布了6.0 RichTextBox !(它是分布式与微软Office 2007但是...有一个例外,没有任何有关其功能的文档。我发现一个列表的添加功能。你可以在这里找到它,还有用于RichTextBox中的所有发行版本的说明。