C#Windows App中的循环槽形式 [英] Loop trough Forms in C# windows App
本文介绍了C#Windows App中的循环槽形式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我创建了一个MDI.在该MDI中,我正在使用多个子窗体.我实现了一个注销菜单项.我希望在单击注销菜单项时关闭所有子窗体.是否有任何方法可以循环浏览MDI中的所有窗体.请帮助.
问候,
Sham
Hello All,
I have created an MDI.In that MDI i am using several child forms .I have implemented a logout menu item.I want all child forms close when i am clicking logout menu item.Is there any way to loop through all forms in MDI.Plese Help.
Regards,
Sham
推荐答案
^ ]
使用 ^ ]:
Use the Form.MdiChildren property[^]:
Form[] children = MdiChildren;
foreach (Form f in children)
{
f.Close();
}
这篇关于C#Windows App中的循环槽形式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文