MessageBox.Show has forms like MessageBox.Show( ownerWindow, .... ).
What do I gain by assigning a owner window?
Calling MessageBox.Show(frmMain,"a message","a title")
adds the form TextDialog
to the application's Application.OpenForms()
forms collection, along-side the frmMain Main form itself. It remains after you close the Messagebox.
I just discovered 14 of these when I called btnOK_Click()
and set a breakpoint.
When I called frmMain.Close()
to close the main form, nothing happened. frmMain will not close until all 14 of the Application.OpenForms are closed as well or else you must call Application.Exit()
.