消息框问题 [英] Message Box Issue

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

问题描述

大家好,我仍然遇到一个问题,即同时从同一表单向用户显示多个消息框

。这个问题

隐藏了表单背后的方框,因为表格大部分时间占用整个

桌面时最大化而且方框只有
$ b使用ALT时$ b可达。单击多个OK按钮后,

应用程序冻结并需要重新启动。


之前我已发布此消息并且一般响应为

" MessageBox.Show()停止调用所有代码,直到用户

单击OK - 在这种情况下,会发生一些事情,允许

代码再次循环,同时显示OK消息框

在屏幕上点击OK然后显示第二条消息

来自同一表格的盒子。


亲眼看看:
http://img456.imageshack.us/img456/3747/untitled3dx.png

这个小的示例应用程序显示了2个消息框,如果这个

是一个较大的程序,那么第二个框需要点击确定,然后单击确定首先是整个程序的后面并且只能通过ALT TAB或在任务栏中单击它来获得

。怎么可能这个

?!?

解决方案

jburkle,

代码?


Kerry Moorman

" jburkle"写道:

大家好,我仍然遇到一个问题,即同时从同一表单向用户显示多个消息框。这个问题隐藏了表单背后的框,因为表单在最大化时大部分时间占用了整个桌面,并且只有在使用ALT时才能访问这些框。单击多个OK按钮后,应用程序冻结并需要重新启动。

我之前已发布此消息并且一般响应是
MessageBox.Show()停止所有代码被调用,直到用户点击OK - 在这种情况下,会发生一些事情,允许
代码再次循环,同时在屏幕上显示OK消息框
然后单击确定然后显示第二个消息
框来自同一个表格。

亲眼看看:
http://img456.imageshack.us/img456/3747/untitled3dx.png

这个小示例应用程序显示了2个消息框,如果这个
是一个较大的程序然后第二个框需要点击确定首先将在整个程序后面,只能通过ALT TAB或在任务栏中单击它可以访问。这怎么可能?!?



展开 | 选择 | Wrap | 行号

我要做的第一件事是重构所有如果用the

自定义异常保护条款而不是exitSub'的

http://www.refactoring.com/catalog/r...rdClauses.html


-

--Eric Cathell,MCSA

" jburkle" < JB ***** @ gmail.com>在消息中写道

news:11 ********************** @ g44g2000cwa.googlegr oups.com ...

展开 | 选择 | Wrap | 行号


Hello all, I am still having an issue where multiple Message Boxes are
being displayed to the user from the same form at one time. This issue
hides the boxes behind the forms since the forms take up the whole
desktop most of the time when maximumized and also the boxes are only
reachable when ALT is used. Once the multiple OK buttons are clicked
the application freezes up and needs to be restarted.

I have posted this before and the general response is
"MessageBox.Show() stops all code from being called until the user
clicks OK" - while in this situation, something happens that allows the
code to be looped through again while the OK Message Box is displayed
on screen BEFORE the OK is clicked which then shows a second Message
Box from the same form.

See for yourselves:
http://img456.imageshack.us/img456/3747/untitled3dx.png
This small example application has displayed 2 Message Boxes, if this
were a larger sized program then the second box which needs to be
clicked OK first would be behind the whole program and only reachable
through ALT TAB or clicking on it in the taskbar. How is this
possible?!?!

解决方案

jburkle,

Code?

Kerry Moorman
"jburkle" wrote:

Hello all, I am still having an issue where multiple Message Boxes are
being displayed to the user from the same form at one time. This issue
hides the boxes behind the forms since the forms take up the whole
desktop most of the time when maximumized and also the boxes are only
reachable when ALT is used. Once the multiple OK buttons are clicked
the application freezes up and needs to be restarted.

I have posted this before and the general response is
"MessageBox.Show() stops all code from being called until the user
clicks OK" - while in this situation, something happens that allows the
code to be looped through again while the OK Message Box is displayed
on screen BEFORE the OK is clicked which then shows a second Message
Box from the same form.

See for yourselves:
http://img456.imageshack.us/img456/3747/untitled3dx.png
This small example application has displayed 2 Message Boxes, if this
were a larger sized program then the second box which needs to be
clicked OK first would be behind the whole program and only reachable
through ALT TAB or clicking on it in the taskbar. How is this
possible?!?!



Expand|Select|Wrap|Line Numbers


First thing I would do is refactor all the if thens to guard clauses with
custom exceptions instead of exitSub''s

http://www.refactoring.com/catalog/r...rdClauses.html

--
--Eric Cathell, MCSA
"jburkle" <jb*****@gmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...

Expand|Select|Wrap|Line Numbers


这篇关于消息框问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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