//定义一个需要string类型参数的委托
publicdelegate void MyDelegate(string text);
public partial class Form2 :Form1
{
//定义该委托的事件
public event MyDelegate MyEvent;
public Form2(string text)
{
InitializeComponent();
this.textBox1.Text = text;
}
private void btnChange_Click(object sender, EventArgs e)
{
//触发事件,并将修改后的文本回传
MyEvent(this.textBox1.Text);
this.Close();
}
}