本文介绍了如何关闭从子形式的父窗体在Windows窗体2.0吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要从子窗体中的Windows应用程序关闭父窗体。什么是做到这一点的最好方法是什么?
I have a need to close a parent form from within child form from a Windows application. What would be the best way to do this?
推荐答案
在你的WinForms紧密的形式,它部署它的所有儿童。因此,这不是一个好主意。你需要做的是异步的,例如,你可以发送邮件到父窗体。
When you close form in WinForms it disposes all of it's children. So it's not a good idea. You need to do it asynchronously, for example you can send a message to parent form.
这篇关于如何关闭从子形式的父窗体在Windows窗体2.0吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!