winform application master form

ぐ巨炮叔叔 提交于 2019-12-06 01:55:21

to simulate master-pages in winform you could cretae a base form, create either a class that inherits from System.windows.Forms or simply add a new form to your project, add the common controls and then create any other form adding an "Inherited Form" select the base form created and that should work

http://www.akadia.com/services/dotnet_inherited_forms.html

There really isn't anything baked-in within Winform that works like ASP.NET master pages.

The closest you can get is having template forms with holes to be filled with user controls. You can connect your controls to "services" instances of the main form represented as interfaces types so that you can react on actions taken on controls owned by the template.

Be warned though, this isn't trivial and you're likely to face some unexpected limitations. Winform might not be the best platform for your new application because of that.

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