Detect when a form has been closed c#

前端 未结 7 1968
猫巷女王i
猫巷女王i 2020-12-06 16:51

I have a WinForm that I create that shows a prompt with a button. This is a custom WinForm view, as a message box dialog was not sufficient.

I have a background work

7条回答
  •  半阙折子戏
    2020-12-06 17:42

    You might be going overkill. To show a form like a dialog window and wait for it to exit before returning control back to the calling form, just use:

    mySubForm.ShowDialog();

    This will "block" the main form until the child is closed.

提交回复
热议问题