Hi How can i achieve master child page concept in c# winforms application?
Regards, Nagu
Hi How can i achieve master child page concept in c# winforms application?
Regards, Nagu
Assuming you mean MasterPage type mechanics of ASP.Net, you could set about it by having a form called MasterForm
, and then creating other forms, which instead of inheriting from System.Windows.Forms.Form
, inherit from your MasterForm
.
This means you can place controls on the MasterForm
(such as the menu or status bars) which will then appear on your inherited child forms
You shouldn't need the page.master concept from WebForms in a Windows application. Page masters are a workaround for the fact that WebForms can't inherit the UI, only the underlying classes.
In Windows development you don't have this problem, so you can have a base control with the 'master' layout and subforms that inherit from it.
For instance you could create your own BaseForm
that inherits Form
but adds some standard components to every form.
However in Windows forms it's probably better to stick with the standard (and commonly understood) convention of nested controls on the forms.