检测何时没有显示mdi子窗口 [英] Detect when no mdi child windows displayed

查看:65
本文介绍了检测何时没有显示mdi子窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以检查MdiChildren.Length = 0,但是我应该把这个事件处理程序用于检测子窗口何时关闭?


TIA

Phil。

解决方案

" Phil" < N / A>'狂野的想法于8月1日星期三发布

2007 16:08:34 +0100带有以下成果:


>我可以检查MdiChildren.Length = 0,但我应该把这个事件处理程序用于检测子窗口何时关闭?



另一个我想知道为什么?

-

Jan Hyde

https://mvp.support.microsoft.com/profile/Jan.Hyde


8月1日上午11:08,Phil < N / Awrote:


我可以检查MdiChildren.Length = 0,但我应该将哪个事件处理程序放入

检测儿童窗户何时关闭?


TIA

菲尔。



子窗体应该公开一个FormClosed事件,您可以在将它们添加到mdi窗体时添加一个

事件处理程序。 br />

我也像Jan一样好奇,你有什么理由这样做?


谢谢,


Seth Rowe


>>我可以查看MdiChildren.Length = 0,但我应该把哪个事件处理程序放入
< blockquote class =post_quotes>


>>这用于检测子窗口何时关闭?



另一个我想知道为什么?



我不知道为什么你需要知道原因,但是因为你问:在这个

特定的应用中,当一个或者显示更多mdi子表单,

应用程序可能被视为活动。如果没有显示任何表格,

应用程序基本上是不活动的,所以我可能会在这种情况下发生各种各样的事情。它可能就像在背景上画一些

一样简单,或者可能还有其他一些内务处理任务

可以在这个阶段完成。

我可以在每个子表单的Close事件中放入一些代码,但我可能有几个不同的表单,所以如果mdi父级可以检测到
$ b会更好当没有更多的子表单时,$ b。如果每次儿童表格关闭时父母都会被解雇,那么我可以在那时检查

剩余多少孩子。这可能吗?

谢谢

Phil。


I can check for MdiChildren.Length=0, but which event handler should I put
this in to detect when a child window is closed?

TIA
Phil.

解决方案

"Phil" <N/A>''s wild thoughts were released on Wed, 1 Aug
2007 16:08:34 +0100 bearing the following fruit:

>I can check for MdiChildren.Length=0, but which event handler should I put
this in to detect when a child window is closed?

Another one I''m wondering why?
--
Jan Hyde

https://mvp.support.microsoft.com/profile/Jan.Hyde


On Aug 1, 11:08 am, "Phil" <N/Awrote:

I can check for MdiChildren.Length=0, but which event handler should I put
this in to detect when a child window is closed?

TIA
Phil.

The child forms should expose a FormClosed event that you could add an
event handler to when you add them to your mdi form.

I also am curious like Jan, what reason do you have for doing this?

Thanks,

Seth Rowe


>>I can check for MdiChildren.Length=0, but which event handler should I put

>>this in to detect when a child window is closed?


Another one I''m wondering why?

I''m not sure why you need to know why, but since you asked: In this
particular application, when one or more mdi child forms are displayed, the
application might be considered ''active''. If there are no forms displayed,
the application is basically inactive, so there are various things I might
want to happen in this situation. It might be as simple as doing some
drawing on the background, or there might be some other housekeeping tasks
that can be done at this stage.
I could put some code in the Close event for each child form, but I may have
several different forms, so it would be nicer if the mdi parent could detect
when there are no more child forms left. If there is an event that is fired
in the parent each time a child form is closed, I can check at that point
how many children are remaining. Is this possible?
Thanks
Phil.


这篇关于检测何时没有显示mdi子窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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