C#父窗体关闭打开的子窗体

显示窗体:

 

 

 

try

            {

                Form loadingform 
= new loading();

                loadingform.StartPosition 
= FormStartPosition.CenterParent;

                loadingform.ShowDialog();

            }

            
catch

            {



            }

 

关闭窗体:

 

Application.OpenForms["loadingform"].Close();

 

 

 

参考

http://msdn.microsoft.com/zh-cn/library/system.windows.forms.application.openforms(VS.80).aspx

 

 

 

posted @ 2010-05-08 16:11  wangbin5542  阅读(695)  评论(0编辑  收藏  举报