【发布时间】:2017-12-02 10:39:33
【问题描述】:
我正在尝试使用此代码检测 C# 中打开的表单;
if ((Application.OpenForms["Form1"] as Form1) != null)
{
Application.OpenForms["Form1"].Close();
}
但我的表单有ShowInTaskBar = false,我的代码不起作用。
如果表单具有属性ShowInTaskBar = false,我如何检测打开或关闭的表单?
【问题讨论】:
-
如果表单属性为 ShowInTaskBar=false;此解决方案不起作用