Communicate between two windows forms in C#

后端 未结 12 1816
温柔的废话
温柔的废话 2020-11-21 04:40

I have two forms, one is the main form and the other is an options form. So say for example that the user clicks on my menu on the main form: Tools -> Options

12条回答
  •  你的背包
    2020-11-21 05:35

    The best in this case would be to have some OptionsService class/interface that is accessible via IServiceProvider.

    Just add an event when something changes, and the rest of the app can respond to it.

提交回复
热议问题