利用TextEditorControl控件现代码语法高亮显示

这是一个利用ICSharpCode.TextEditor.TextEditorControl控件的C#示例程序,展示了如何实现代码语法高亮显示。通过设置HighlightingStrategy,支持C#、C++.NET、XML、HTML、Java和VB.NET等语言的高亮。
摘要由CSDN通过智能技术生成

/**********************************************************************************************
 * 创建时间: 2005-1-19 16:32:06
 * 作者:  Jack
 * 
 * 介绍:  一个利用ICSharpCode.TextEditor.TextEditorControl控件
 *    实现代码语法高亮显示的示例程序,需要引用ICSharpCode.TextEditor.dll文件
 *    该文件可以在#develop的库中找到
 **********************************************************************************************/

#region UsingBlock

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using ICSharpCode.TextEditor;
using ICSharpCode.TextEditor.Gui.CompletionWindow;
using ICSharpCode.TextEditor.Document;
using ICSharpCode.TextEditor.Actions;

#endregion

namespace HighLightingCodeFile
{
 /// <summary>
 /// ICSharpCode.TextEditor.
 /// TextEditorControl的示例程序
 /// </summary>
 public class TestCSharpTextBox : System.Windows.Forms.Form
 {
  #region 私有属性

  private ICSharpCode.TextEditor.TextEditorControl textEditorControl;
  private System.Windows.Forms.MainMenu mainMenu;
  private System.Windows.Forms.MenuItem menuItem1;
  private System.Windows.Forms.MenuItem OpenMenu;
  private System.Windows.Forms.MenuItem Save;
  private System.Windows.Forms.SaveFileDialog saveFileDialog;
  private System.Windows.Forms.OpenFileDialog openFileDialog;
  private System.Windows.Forms.MenuItem menuItem2;
  private System.Windows.Forms.MenuItem menuItem3;
  private System.Windows.Forms.MenuItem menuItem4;
  private System.Windows.Forms.MenuItem menuItem5;
  private System.Windows.Forms.MenuItem menuItem6;
  private System.Windows.Forms.MenuItem menuItem7;
  private System.Windows.Forms.MenuItem menuItem8;
  
  #endregion
  
  #region 属性
  
  #endregion
  
  #region 构造函数
  
  public TestCSharpTextBox()
  {
   //

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值