winform图文编辑器三个开源项目

4340阅读 0评论2016-04-01 dyli2000
分类:C#/.net

说明,这三个开源工程都是来自codeproject

1、TextControl

image
TextControlSource.zip
本案例实现Tab和Ctrl+S的办法:


  1. ///
  2.         /// 根据反向回调调用窗体的方法
  3.         ///
  4.         private void webBrowser1_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
  5.         {
  6.             if (e.Modifiers == Keys.Control && e.KeyCode == Keys.S)
  7.             {
  8.                 if (this.Name.Equals("editorChild") && this.ParentForm is EditExamQuestion)
  9.                     ((EditExamQuestion)this.ParentForm).ChildNodeSave();

  10.                 if (this.Name.Equals("editorRoot") && this.ParentForm is EditExamQuestion)
  11.                     ((EditExamQuestion)this.ParentForm).RootNodeSave();

  12.                 if (this.Name.Equals("editorTopic") && this.ParentForm is EditExamQuestion)
  13.                     ((EditExamQuestion)this.ParentForm).EditorTopicSave();
  14.             }
  15.             
  16.             if (e.KeyData == Keys.Tab)
  17.                 Indent();

  18.             if (e.Modifiers == Keys.Shift && e.KeyCode == Keys.Tab)
  19.                 Outdent();

  20.             this.webBrowser1.Focus();
  21.         }


2、ZetaHtmlEditControl

image
zetahtmleditcontrol-source.zip

3、FsRichTextBox

image
FsRichTextBox.rar

说明:

前两个是基于WebBroswer来实现。FsRichTextBox是基于richtextbox,没有图片导入及编辑功能。

目前三个开源版本都无法实现行间距的设置。待进一点研究。

上一篇:试图吊销一个未注册的拖放目标
下一篇:WPF添加具有相对路径的Component Resource