Compact Framework - get all open forms

我只是一个虾纸丫 提交于 2019-12-04 19:38:12

You can create a FormManager class that you use to instantiate all of your forms. This would give the manager the opportunity to track the lifespan of those forms by listening for their Close event, and to call methods on them en masse if they utilize a common interface (say one with a OnUiLanguageChanged method).

Alternatively, you can create an object in your application that exposes an event that each Form can subscribe to. In that way, you don't need to know which forms are open. Intsead all open forms are listening for a UiLanguageChanged event as long as they aer open, and if they recieve it they can update themselves appropriately.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!