MessageBox loses focus in maximized MDI form

风流意气都作罢 提交于 2019-12-07 14:49:53

问题


I have an MDI application (written in .NET 2.0) which lets users open multiple child forms. The child forms are always maximized inside the MDI parent. When the MDI parent is maximized and I attempt to do a MessageBox.Show, the MessageBox doesn't show. If I do an alt-tab (or even just press alt) the MessageBox pops to the front.

Any ideas how to make that sucker show up to begin with?

This is only a problem when the MDI parent is maximized...


回答1:


Try using MessageBox.Show(Window owner, string message, string caption) Setting the MDI application as owner so the MB is shown in the front

Ah, you should also add some tags to your post.



来源:https://stackoverflow.com/questions/97344/messagebox-loses-focus-in-maximized-mdi-form

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!