tags:

views:

191

answers:

2

Hi How can i achieve master child page concept in c# winforms application?

Regards, Nagu

+1  A: 

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

Pondidum
ya this is some thing gives me an idea. But my intention is when i click on a button of page1 i want to load page2 in page1
Nagu
A: 

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.

Keith
thank you for your reply.. just i want to know the concept like response.redirect("newpage"); in winforms. How can i achieve
Nagu
new Newpage().Show() will display an instance of the form, alternatively you can load a control into your existing form.
Keith