我有两种形式,我打开并显示第二种形式的对话框是这样的:
Recieving_Stock_Form f = new Recieving_Stock_Form();
f.Username = Username;
f.Role = Role;
f.Date = monthCalendar1.SelectionStart.ToString(@"yyyy\/MM\/dd");
f.ShowDialog();
现在,当我关闭第二个表单时,我想在第一个表单上触发一个事件 E.G
void txtStockCount_TextChanged(object sender, EventArgs e)
我可以在哪里查找有关此内容或如何执行的任何想法?
谢谢
最佳答案
在Form1
中,假设你的代码是这样的
Recieving_Stock_Form f = new Recieving_Stock_Form();
你可以添加代码
f.Form_Closing += ExampleHandler;
ExampleHandler(object sender, FormClosingEventArgs e)
{
//Do stuff
}
关于c# - 当第二个窗体关闭时在第一个窗体上调用事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40086934/