开发者

Is it possible to use ShowDialog from MdiChildForm without blocking all others MdiChildForms and MdiParent?

开发者 https://www.devze.com 2023-02-05 01:41 出处:网络
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.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消