一、打开Form.cs文件,写入3个一般形式的EventArgs事件show1(),show2(),show3()。
using System;
using System.Windows.Forms;namespace WindowsFormsApplication2
{public partial class Form1 : Form{public Form1(){InitializeComponent();}private void show1(object sender, EventArgs e){MessageBox.Show("a");}private void show2(object sender, EventArgs e){MessageBox.Show("b");}private void show3(object sender, EventArgs e){MessageBox.Show("c");}}
}
二、从Form.cs中可以
看到,程序是从public Form1()中的InitializeComponent()开始的,下面请看原型的InitializeComponent(),打开Form1.Designer.cs,在其中加入的button1中加入三个注册方法&#x