form2.cs

来自「案例经典」· CS 代码 · 共 71 行

CS
71
字号
using System;using System.Collections;using System.ComponentModel;using System.Drawing;using System.Windows.Forms;namespace Example005_继承窗体的设计{	public class Form2 : Example004_基窗体的设计.Form1	{		private System.ComponentModel.IContainer components = null;		public Form2()		{			// 该调用是 Windows 窗体设计器所必需的。			InitializeComponent();			// TODO: 在 InitializeComponent 调用后添加任何初始化		}		/// <summary>		/// 清理所有正在使用的资源。		/// </summary>		protected override void Dispose( bool disposing )		{			if( disposing )			{				if (components != null) 				{					components.Dispose();				}			}			base.Dispose( disposing );		}		#region Designer generated code		/// <summary>		/// 设计器支持所需的方法 - 不要使用代码编辑器修改		/// 此方法的内容。		/// </summary>		private void InitializeComponent()		{			this.SuspendLayout();
			// 
			// button1
			// 
			this.button1.Visible = true;
			this.button1.Click += new System.EventHandler(this.button1_Click);
			// 
			// Form2
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.ClientSize = new System.Drawing.Size(200, 141);
			this.Controls.AddRange(new System.Windows.Forms.Control[] {
																		  this.button1});
			this.Name = "Form2";
			this.ResumeLayout(false);

		}		#endregion

		private void button1_Click(object sender, System.EventArgs e)
		{
			MessageBox.Show("真的可以修改");
		}	}}

⌨️ 快捷键说明

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