// 找活动状态中的窗口
Form form = Form.ActiveForm.FindForm();
Console.WriteLine("ActiveForm.FindForm:" + form.GetType());
// 找应用中的窗口
FormCollection formCollection = Application.OpenForms;
foreach (Form formNO in formCollection)
{
if (formNO is Form1 form1)
{
Console.WriteLine("FormCollection.FindForm:" + form.GetType());
// form1.StatusBarShow(sCADABool, mQTTBool, triggerBool);
return;
}
}
标签:名找,窗口,Form,form,ActiveForm,Console,FindForm,WinForm
From: https://www.cnblogs.com/qq2806933146xiaobai/p/17221097.html