How to use Visual Inheritance in VS2010 .

Your Ad Here

How to use Visual Inheritance in VS2010?

First of all i would like to explain a bit about the inheritance, Inheritance is one of the most important property of Object Oriented Programming language ,by which we reuse the code and extend the existing functionality where there is a relation of "IS A" exists in two classes . For example

Lets take an example in C#

public class base
public base(){

System.out.println("base class Constructor");
public void print ()
System.out.println("Base Class");
public class derived :base
public derived()

System.out.println("derived class");

public void printEx(){

System.out.println("Printinng extended functionality");



This is how we use inheritance in C# but we are lacking this feature in Windows Forms applications where we want to reuse the existing windows forms to extend the functionality.This feature is available now in VS2010 where we can use our existing Win Form as base form to inherit from , thats called
visual inheritance.

Steps to use Visual inheritance in VS2010

1: Create a Windows Form project in VS2010
2: By default one Win Form will be added with name Form1.cs or vb. whatever language you use for creating Win Apps
3: Design this form
4: Build the project so that DLL is build for this project
5: Now add one more Win Form to project and select Inherited Form as given below in figure.

Note : if you dont compile your Form1.cs than you will not be able to add Form1.cs as base form to inherit from.
6: Now you will see that your Form2.cs will have all the controls of your base Form1.cs on your Form2.cs

Now question arises, how to access the controls of base class ie Form1.cs.

1: Best practices say that you should provide public getter and setter on the base class.
2: You can change the access modifier of base class(Form1.cs) control to Public or Protected as per your design .

Now build the application and run it .

Happy Coding.

Posted in Labels: , kick it on |


  1. Anonymous Says:


    [b]Xrumer SEO Professionals

    As Xrumer experts, we from been using [url=]Xrumer[/url] fitted a wish leisure conditions and remember how to harness the colossal power of Xrumer and adapt it into a Cash machine.

    We also yield the cheapest prices on the market. Numberless competitors see fit expect 2x or even 3x and a destiny of the term 5x what we debt you. But we feel in providing enormous mending at a tearful affordable rate. The entire direct attention to of purchasing Xrumer blasts is because it is a cheaper alternative to buying Xrumer. So we focusing to stifle that mental activity in rebuke and provide you with the cheapest rate possible.

    Not solitary do we have the greatest prices but our turnaround time after your Xrumer posting is super fast. We intention have your posting done ahead of you discern it.

    We also cater you with a roundish log of successful posts on manifold forums. So that you can notice over the extent of yourself the power of Xrumer and how we hold harnessed it to help your site.[/b]

    [b]Search Engine Optimization

    Using Xrumer you can think to distinguish thousands upon thousands of backlinks exchange for your site. Tons of the forums that your Install you force be posted on bear exalted PageRank. Having your join on these sites can truly help found up some crown quality back links and as a matter of fact riding-boot your Alexa Rating and Google PageRank rating utterly the roof.

    This is making your position more and more popular. And with this developing in popularity as superbly as PageRank you can envisage to appreciate your place in effect filthy high in those Search Motor Results.

    The amount of traffic that can be obtained by harnessing the power of Xrumer is enormous. You are publishing your situation to tens of thousands of forums. With our higher packages you may still be publishing your position to HUNDREDS of THOUSANDS of forums. Imagine 1 mail on a stylish forum disposition usually rig out 1000 or so views, with announce ' 100 of those people visiting your site. Modern assume tens of thousands of posts on fashionable forums all getting 1000 views each. Your freight longing withdraw because of the roof.

    These are all targeted visitors that are interested or bizarre far your site. Assume how assorted sales or leads you can fulfil with this great gang of targeted visitors. You are line for line stumbling upon a goldmine ready to be picked and profited from.

    Remember, Shipping is Money.


  2. Anonymous Says:

    Predilection casinos? replacement this advanced [url=]casino[/url] advisor and defer online casino games like slots, blackjack, roulette, baccarat and more at .
    you can also choose through our additional [url=]casino[/url] use at and acquire arrant away misled !
    another late-model [url=]casino spiele[/url] in the concoct of is , in the thoroughfare of german gamblers, prohibit upon during unrestrained online casino bonus.

  3. Anonymous Says:

    I would like to show you some of my websites that can afford you is very much appealing. These are new things on the network and so amuse suffer with us with their assessment. It is awfully noteworthy to me, so I want you to be forgiving. The best of these is unmistakably the projektowanie wnętrz, projektowanie wnętrz I hope that you intent like it there too much like me. Best wishes!