I need to open modal form (frmD) from MdiChild (frmB) form without blocking main form (frmA) and all others opened MdiChild forms (frmC). Then i switch to frmC the frmD is hidden.
This is the similar question, but not for Mdi application.
Is there a way to open a moda开发者_JAVA技巧l dialog and only have it block the mdi child form that opened it?
One possible strategy is described in this article, which relies on using the .Show()
method instead of .ShowDialog()
to open the modal dialog and setting the MdiChild's Enabled
property to false just before you call the .Show()
method.
You then need to set the Enabled
property of your MdiChild back to true when the dialog is closed, which means that you will need to create an event handler in your MdiChild form to handle the FormClosing
event of the dialog.
精彩评论