privatevoidbutton1_Click(objectsender,EventArgse) { Form2f =newForm2(); f.SetTextEvent += Test; f.ShowDialog(); }
privatevoidTest(strings) { textBox1.Text = s; }
在B窗体中(不需要传参数可以不用
在B窗体被加载时,会调用A窗体的Test方法