对话框的MessageBox有时隐藏在主窗体后面

对话框的MessageBox有时隐藏在主窗体后面

本文介绍了对话框的MessageBox有时隐藏在主窗体后面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的一些非技术用户都具有其中在我们的应用程序对话框的MessageBox有时可以显示在主窗体后面,直到在MessageBox(他们看不到)被驳回申请,不接受任何输入的问题。

Some of our non-technical users are having problems where a dialog MessageBox in our application can sometimes be displayed behind the main form and the application does not accept any input until the messagebox (which they can't see) is dismissed.

该应用程序是用C#和消息框是标准例如,作为MessageBox.Show(消息,标题)和消息框可以通过创建的代码可以很简单主UI线程(即不是一些后台线程)。该应用没有被全屏运行,但90%的用户不运行全屏。

The application is written in C# and the message boxes are standard eg the code can be as simple as MessageBox.Show(message, caption) and the messageboxes can be created by the main UI thread (ie not some background thread). The Application does not have to be run full-screen, but 90% of our users do run it full-screen.

大多数时候((也许> 99% )的消息框显示正确,我从来没有成功地看看它是如何出错,但我所看到的时候它已经错了一台机器。

Most of the time ((maybe > 99%) the messageboxes display correctly and I have never managed to see how it goes wrong, but I have seen a machine when it has gone wrong.

有一件事我没有通知是如果你有这显示一个对话框,然后当你看看你的任务管理器的应用程序,你正常只看到在应用程序列表中的一个条目。每当在MessageBox是隐藏的,你会看到两个条目,一个用于主要应用与另一进入此消息框。

One thing I did notice is that if you have an application which displays a dialog box, then when you look at your taskmanager, you normal only see one entry in the application list. Whenever the messagebox is hidden, you will see two entries, one for the main application and another entry for this message box.

这是很容易,一旦你知道发生了什么事来解决这个问题,但我们的一些非技术用户通过它,搞不清楚到底达关掉他们的电脑。(谁正在使用远程桌面的是更加迷茫的时候,不解决这个问题)。

It is easy enough to fix the problem once you know what has happened, but some of our non-technical users are confused by it and end up switching off their computers. (And the ones who are using Remote Desktop are even more confused when that doesn't solve the problem).

我不认为这是因为我已经看到它在Vista中发生,被告知这也发生在Windows 2003服务器上的终端会话相关的操作系统。

I do not think it is related to the operating system as I have seen it happen in Vista and have been told it also happens in a terminal session on a Windows 2003 server.

做任何事情知道为什么正在发生,更重要的是,如果什么都可以做,以避免它?

Does anything know why this is happening and more importantly if anything can be done to avoid it?

推荐答案

的MessageBox的一些重载.Show()方法采取 IWin32Window 参数作为第一个参数。如果您在表格作为第一个参数传递给它应防止这种情况的发生。

Some overloads of the MessageBox.Show() method take an IWin32Window parameter as the first argument. If you pass in your Form as that first argument it should prevent this from happening.

这篇关于对话框的MessageBox有时隐藏在主窗体后面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 14:19