您正在将事件处理程序添加到另一个ChildForm实例.将MainForm的button1_click更改为如下所示:
private void button1_Click(object sender, EventArgs e) { ChildFrm.ShowDialog() }
你的应用程序应该工作正常.
这是有效的MainForm.cs:
public partial class Form1 : Form { public Form1() { InitializeComponent(); ChildFrm.MyEvent += new EventHandler(HandleTheEvent); } ChildForm ChildFrm = new ChildForm(); private void button1_Click(object sender, EventArgs e) { ChildFrm.ShowDialog(); } public void HandleTheEvent(object sender, EventArgs e) { textBox1.Text = "event is fired"; } }