Can_ListCandidate
表单以及其他一些打开的表单。每当我单击一个按钮时,所有Can_ListCandidate
表格都会关闭。我已经尝试了下面的代码,但是没有用。
Can_ListCandidate frm = new Can_ListCandidate();
foreach (Form f in this.MdiChildren)
{
if (f == frm)
{
frm.Dispose();
return;
}
}
或者
Can_ListCandidate frm = new Can_ListCandidate();
foreach (Form f in this.MdiChildren)
{
if (f is Can_ListCandidate)
{
frm.Dispose();
return;
}
}
foreach (Form frm in this.MdiChildren)
{
if (frm.GetType() == typeof(Can_ListCandidate))
{
frm.Dispose();
//return;
}
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句