开发者

Windows Forms find all the active Form instance types

开发者 https://www.devze.com 2023-01-08 22:59 出处:网络
WinForms, how to f开发者_Python百科ind all the active windows of specific instance type. You could do something like this using LINQ:

WinForms, how to f开发者_Python百科ind all the active windows of specific instance type.


You could do something like this using LINQ:

var forms = from f in Application.OpenForms.OfType<Form1>()
            select f;

Or if you had additional criteria, something like:

var forms = from f in Application.OpenForms.OfType<CustomerForm>()
            where f.HasChanges
            select f;
0

精彩评论

暂无评论...
验证码 换一张
取 消