⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.cs

📁 ASCII HEX Editor 國外源碼可參考一下
💻 CS
字号:
/*
***************************************************************************
** 
** Module: Form1.cs
** 
** Description:
** 
** 
** Revision History:
** ------------------------------------------------------------------------
** Date        Name         Reason
** 9/20/2005    HGI          Initial Creation
** 
** 
** 
*/
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using HexEdit;

namespace HexEditExample
{
	/// <summary>
	/// Summary description for Form1.
	/// </summary>
	public class Form1 : System.Windows.Forms.Form
	{
        private System.Windows.Forms.Splitter splitter1;
        private HexEdit.HexEditBox m_edtHex;
        private HexEdit.LinkedBox  m_edtASCII;
        private byte[]              m_abyData = new byte[4096];

		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;

		public Form1()
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			//
			// TODO: Add any constructor code after InitializeComponent call
			//
            m_edtHex.InitializeComponent();
            m_edtASCII.InitializeComponent();
            m_edtHex.LinkDisplay(m_edtASCII);

            m_edtHex.LoadData(m_abyData);
		}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if (components != null) 
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
            this.m_edtHex = new HexEdit.HexEditBox();
            this.m_edtASCII = new LinkedBox();
            this.splitter1 = new System.Windows.Forms.Splitter();
            this.SuspendLayout();
            // 
            // m_edtHex
            // 
            this.m_edtHex.Dock = System.Windows.Forms.DockStyle.Left;
            this.m_edtHex.Location = new System.Drawing.Point(0, 0);
            this.m_edtHex.Name = "m_edtHex";
            this.m_edtHex.Size = new System.Drawing.Size(168, 326);
            this.m_edtHex.TabIndex = 0;
            this.m_edtHex.Text = "richTextBox1";
            // 
            // m_edtASCII
            // 
            this.m_edtASCII.Dock = System.Windows.Forms.DockStyle.Fill;
            this.m_edtASCII.Location = new System.Drawing.Point(168, 0);
            this.m_edtASCII.Name = "m_edtASCII";
            this.m_edtASCII.Size = new System.Drawing.Size(320, 326);
            this.m_edtASCII.TabIndex = 1;
            this.m_edtASCII.Text = "foo";
            // 
            // splitter1
            // 
            this.splitter1.Location = new System.Drawing.Point(168, 0);
            this.splitter1.Name = "splitter1";
            this.splitter1.Size = new System.Drawing.Size(1, 326);
            this.splitter1.TabIndex = 2;
            this.splitter1.TabStop = false;
            // 
            // Form1
            // 
            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
            this.ClientSize = new System.Drawing.Size(488, 326);
            this.Controls.Add(this.splitter1);
            this.Controls.Add(this.m_edtASCII);
            this.Controls.Add(this.m_edtHex);
            this.Name = "Form1";
            this.Text = "Form1";
            this.ResumeLayout(false);

        }
		#endregion

		/// <summary>
		/// The main entry point for the application.
		/// </summary>
		[STAThread]
		static void Main() 
		{
			Application.Run(new Form1());
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -