C#/。NET消息框不是模态 [英] C# / .NET messagebox is not modal

查看:134
本文介绍了C#/。NET消息框不是模态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么一个C#/。NET的消息框非模态?

Why is a C#/.NET message box not modal?

一不留神,如果消息框变为我们的主要用户界面背后,然后在主界面没有反应,直到我们点击(我们的消息框)确定。

Accidentally, if the message box goes behind our main UI, then the main UI doesn't respond, until we click OK (on our message box).

难道还有比创建一个自定义消息框以外的其他解决办法?

Is there a workaround other than creating a custom message box?

推荐答案

您需要到MessageBox所有者属性分配给主界面窗口(看第三个构造函数)。

You need to assign the MessageBox owner property to the main UI window (look at the 3rd constructor).

这篇关于C#/。NET消息框不是模态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆