Search - Articles
DevASP.NET for ASP.NET, VB.NET, XML and C# (C-Sharp) Developers Tuesday, March 03, 2009
Dev Articles
Search Directory
SQL Server

Inheritance feature while working with forms in C# using .Net 2.0

Author: Zunnair

In this article you will find out how you can use the inheritance feature in forms working with C#.

It is used to inherit any basic structure logo or watermark, or any control which is used on more than one forms exactly same.

Note: As in C# there is only single inheritance is allowed therefore, a form can be inherited by only one form.


Suppose this is the basic structure of our application’s moat of the forms. We will design a parent form like this and all other forms which require such structure will be its child forms


 Create a form by right clicking on the project à Add à New Item 



Select Windows Form from the built-in templates, Write name of the form and click Add. 



Drag two buttons and a Label to the form. Change properties. Click on the controls to add code.

To create a child form, again right click on the project àAdd àNew Item

Select Inherited Form from the built-in templates, Write name of the form and click Add.


The new created form will be exactly its parent. It can be modified or more controls can be added to it.





Add Article Comment:
Name :
Email Address :
Comments :
<< Retrieving all databases Name from database server using SMO namespace in C# and VB using .NET 2.0.

Disclaimer - Privacy
© 2002-2017