知道mdi孩子何时关闭? [英] Know when an mdi child closes?

查看:94
本文介绍了知道mdi孩子何时关闭?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果MDI孩子关闭,MDI父母表格怎么知道?

我需要知道最后一个关闭的时间因为我在MDI上有什么东西
$ b当所有孩子都关闭时我需要清理$ b表格...


谢谢,


Shane

How can the MDI parent form know when an MDI child closes?

I need to know when the last one closes because I have something on the MDI
form that I need to clear out when all children are closed...

Thanks,

Shane

推荐答案




有更多方法可以解决这个问题。

你可以使用全局计数器在打开时递增或递减,并且b / b
关闭表格。

但在MDIParent窗口中有一个内置计数器。使用这些得到

mdiclient表格数:


[ParentFormName] .MdiChildren.Length


使用从mdichilds或类似的东西回调来通知父母

窗口。

这可以通过子类化或事件处理程序来完成。它给你带来了b $ b ...


查看这个以获取更多信息:

http://msdn.microsoft.com/ library / de ... ldrenTopic.asp


这是没有任何解决方法的最佳解决方案...


祝你好运


KeremGümrükcü
Hi,

there are more ways to solve this.
you can use a global counter and increment or decrement it while opening and
closing forms.
but there is a build in counter in the MDIParent window. use these to get
the mdiclient forms count:

[ParentFormName].MdiChildren.Length

Use a callback from mdichilds or something like that to inform the parent
window.
this can be done with subclassing or eventhandlers for the windows. its up
to you...

check this for more information:

http://msdn.microsoft.com/library/de...ldrenTopic.asp

This is the best solution without any workaround...

Best regards

Kerem Gümrükcü


是的...我需要通知。没有MdiChildClosed活动

有MdiChildActivated .....

无赖......


猜猜我会有让孩子打电话给父母,说要关闭

,然后看看是否有孩子是开放的。


Shane

" ;KeremGümrükcü < KA ******* @ hotmail.com>在留言中写道

news:uj ************* @ tk2msftngp13.phx.gbl ...
Yes... well I am need notification. There is no MdiChildClosed event
There is the MdiChildActivated.....
bummer...

Guess I will have to have the child call the parent someway to say closing
and then see if any children are open.

Shane
"Kerem Gümrükcü" <ka*******@hotmail.com> wrote in message
news:uj*************@tk2msftngp13.phx.gbl...


有更多方法可以解决这个问题。
你可以使用全局计数器,在打开
和关闭表格的同时增加或减少它。
但是有一个内置的计数器MDIParent窗口。使用这些来获取mdiclient表单计数:

[ParentFormName] .MdiChildren.Length

使用mdichilds或类似的回调来通知父<窗口。
这可以通过windows的子类或事件处理程序来完成。它对你来说......

检查这个以获取更多信息:

http://msdn.microsoft.com/library/de...ldrenTopic。 asp
这是没有任何解决方法的最佳解决方案...

最好的问候

KeremGümrükc
Hi,

there are more ways to solve this.
you can use a global counter and increment or decrement it while opening and closing forms.
but there is a build in counter in the MDIParent window. use these to get
the mdiclient forms count:

[ParentFormName].MdiChildren.Length

Use a callback from mdichilds or something like that to inform the parent
window.
this can be done with subclassing or eventhandlers for the windows. its up
to you...

check this for more information:

http://msdn.microsoft.com/library/de...ldrenTopic.asp
This is the best solution without any workaround...

Best regards

Kerem Gümrükcü



Shane,


我没试过这个,但是我会尝试在我的
$ b中举办一个公共活动$ b clossing事件并在我的mainMDI表单中捕获,当我有这个解决时。


我希望这有点帮助。


Cor
Shane,

I did not try this, however I would try it raising a public event in my
clossing event and catch that in my mainMDI form, when I had this to solve.

I hope this helps a little bit.

Cor
是的......我需要通知。没有MdiChildClosed活动
有MdiChildActivated .....
无聊......

猜猜我必须要让孩子打电话给父母,说要关闭<然后看看是否有孩子是开放的。

Shane
KeremGümrükcü < KA ******* @ hotmail.com>在消息中写道
新闻:uj ************* @ tk2msftngp13.phx.gbl ...
Yes... well I am need notification. There is no MdiChildClosed event
There is the MdiChildActivated.....
bummer...

Guess I will have to have the child call the parent someway to say closing
and then see if any children are open.

Shane
"Kerem Gümrükcü" <ka*******@hotmail.com> wrote in message
news:uj*************@tk2msftngp13.phx.gbl...


还有更多方法可以解决这个问题。
你可以使用全局计数器并在打开
Hi,

there are more ways to solve this.
you can use a global counter and increment or decrement it while opening


关闭表单时增加或减少它。
但是在MDIParent窗口中有一个内置计数器。使用这些
获取mdiclient表单计数:

[ParentFormName] .MdiChildren.Length

使用mdichilds或类似的回调来通知
父窗口。
这可以通过windows的子类或事件处理程序来完成。它取决于你的
...

查看此信息以获取更多信息:
closing forms.
but there is a build in counter in the MDIParent window. use these to get the mdiclient forms count:

[ParentFormName].MdiChildren.Length

Use a callback from mdichilds or something like that to inform the parent window.
this can be done with subclassing or eventhandlers for the windows. its up to you...

check this for more information:


http://msdn.microsoft.com/ library / de ... ldrenTopic.asp


这是没有任何解决方法的最佳解决方案...

最好的问候

KeremGümrükc

This is the best solution without any workaround...

Best regards

Kerem Gümrükcü




这篇关于知道mdi孩子何时关闭?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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