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

📄 dataform.cs

📁 学习正则表达式的编写
💻 CS
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

namespace RegexTool
{
	/// <summary>
	/// DataForm 的摘要说明。
	/// </summary>
	public class DataForm : System.Windows.Forms.Form
	{
		private System.Windows.Forms.DataGrid dgData;
		private System.Windows.Forms.Button btnView;
		private System.Windows.Forms.Button btnAdd;
		private System.Windows.Forms.Button btnDelete;
		/// <summary>
		/// 必需的设计器变量。
		/// </summary>
		private System.ComponentModel.Container components = null;

		public DataForm()
		{
			//
			// Windows 窗体设计器支持所必需的
			//
			InitializeComponent();

			//
			// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
			//
		}

		/// <summary>
		/// 清理所有正在使用的资源。
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows 窗体设计器生成的代码
		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(DataForm));
			this.dgData = new System.Windows.Forms.DataGrid();
			this.btnView = new System.Windows.Forms.Button();
			this.btnAdd = new System.Windows.Forms.Button();
			this.btnDelete = new System.Windows.Forms.Button();
			((System.ComponentModel.ISupportInitialize)(this.dgData)).BeginInit();
			this.SuspendLayout();
			// 
			// dgData
			// 
			this.dgData.BackgroundColor = System.Drawing.SystemColors.Control;
			this.dgData.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.dgData.CaptionBackColor = System.Drawing.Color.LightGray;
			this.dgData.CaptionFont = new System.Drawing.Font("华文行楷", 12F, System.Drawing.FontStyle.Bold);
			this.dgData.CaptionForeColor = System.Drawing.Color.SaddleBrown;
			this.dgData.CaptionText = "典型正则表达式";
			this.dgData.DataMember = "";
			this.dgData.HeaderForeColor = System.Drawing.SystemColors.ControlText;
			this.dgData.Location = new System.Drawing.Point(8, 4);
			this.dgData.Name = "dgData";
			this.dgData.PreferredColumnWidth = 130;
			this.dgData.RowHeaderWidth = 25;
			this.dgData.Size = new System.Drawing.Size(420, 372);
			this.dgData.TabIndex = 1;
			// 
			// btnView
			// 
			this.btnView.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.btnView.Location = new System.Drawing.Point(436, 32);
			this.btnView.Name = "btnView";
			this.btnView.TabIndex = 1;
			this.btnView.Text = "查看";
			this.btnView.TextAlign = System.Drawing.ContentAlignment.TopCenter;
			this.btnView.Click += new System.EventHandler(this.btnView_Click);
			// 
			// btnAdd
			// 
			this.btnAdd.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.btnAdd.Location = new System.Drawing.Point(436, 80);
			this.btnAdd.Name = "btnAdd";
			this.btnAdd.TabIndex = 2;
			this.btnAdd.Text = "添加";
			this.btnAdd.TextAlign = System.Drawing.ContentAlignment.TopCenter;
			this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
			// 
			// btnDelete
			// 
			this.btnDelete.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
			this.btnDelete.Location = new System.Drawing.Point(436, 128);
			this.btnDelete.Name = "btnDelete";
			this.btnDelete.TabIndex = 3;
			this.btnDelete.Text = "删除";
			this.btnDelete.TextAlign = System.Drawing.ContentAlignment.TopCenter;
			// 
			// DataForm
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.ClientSize = new System.Drawing.Size(520, 377);
			this.Controls.Add(this.btnDelete);
			this.Controls.Add(this.btnAdd);
			this.Controls.Add(this.btnView);
			this.Controls.Add(this.dgData);
			this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
			this.MaximizeBox = false;
			this.MinimizeBox = false;
			this.Name = "DataForm";
			this.ShowInTaskbar = false;
			this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
			this.Text = "典型正则表达式";
			this.Load += new System.EventHandler(this.DataForm_Load);
			((System.ComponentModel.ISupportInitialize)(this.dgData)).EndInit();
			this.ResumeLayout(false);

		}
		#endregion

		private void btnAdd_Click(object sender, System.EventArgs e)
		{
			InsertForm insertForm = new InsertForm();
			insertForm.Show();
		}

		private void DataForm_Load(object sender, System.EventArgs e)
		{
			DataSet ds = new DataSet();
			ds.ReadXml("Data.xml");
			dgData.DataSource = ds.Tables[0];
			
			//dgData.DataBindings();
		}
		//在主窗口中查看正则表达式
		private void btnView_Click(object sender, System.EventArgs e)
		{
			
		}
	}
}

⌨️ 快捷键说明

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