Reputation: 95
I was working on an application using asp.net and C# and It made it very easy to develop using the notion of Master Pages. now I am trying to develop a windows form application and I really need to have a master page here also. is there anything such as a master form ?
thank you
Upvotes: 3
Views: 8370
Reputation: 189
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
Upvotes: 2
Reputation: 10478
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.
Upvotes: 0