开发者

Windows Forms find all the active Form instance types

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜