嵌入式窗体OnClose和OnClosing事件不会触发 [英] Embedded Forms OnClose and OnClosing Event won't fire
本文介绍了嵌入式窗体OnClose和OnClosing事件不会触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一段时间这个问题了.
我在嵌入式Form的OnClosed和OnClosing事件中都设置了一个断点进行测试,并且这些事件中的代码都不会被调用.
我该如何触发这些事件?
我的MainForm中的OnClosed和OnClosing事件正常工作.
谢谢,
Donnelly
I''ve had this problem for a while.
I put a break point to test in both the embedded Form''s OnClosed and OnClosing Events and the code in these event don''t get called.
How do I get these events to fire?
The OnClosed and OnClosing Events in my MainForm works properly.
Thanks,
Donnelly
推荐答案
如果可以获取嵌入式表单的实例,则可能需要尝试在主表单上调用其Close()方法.的OnClosing事件.我认为可以调用嵌入式表单的事件.
问候,
曼弗雷德(Manfred)
If it''s possible to get at the instance of the embedded form you may want to try and call its Close() method on your main form''s OnClosing event. I figure that way the embedded form''s events might be called.
Regards,
Manfred
这篇关于嵌入式窗体OnClose和OnClosing事件不会触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文