FormClosing delegate not working with ShowDialog() method
-
30-10-2019 - |
题
In my C# WinForms program I have some forms and I show one of them as a dialog:
MyForm mf = new MyForm();
mf.ShowDialog();
But when I try to assigne a form closing event for them, it is not working;
mf.FormClosing += delegate { MessageBox.Show("Dialog is closed.")};
What is the problem?
P.S: It works fine when I call the form using mf.Show() method.
Thanks.
没有正确的解决方案
不隶属于 StackOverflow