VB.Net
  Home arrow VB.Net arrow Page 3 - Everything You Wanted to Know About Forms ...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Moblin 
JMSL Numerical Library 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
VB.NET

Everything You Wanted to Know About Forms Inheritance in VB.Net
By: Saurabh Verma
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 179
    2003-10-29

    Table of Contents:
  • Everything You Wanted to Know About Forms Inheritance in VB.Net
  • Concept of Inheritance
  • Visual Inheritance
  • What’s New in This Article
  • What's New in This Article, Cont'd
  • Conclusion

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Everything You Wanted to Know About Forms Inheritance in VB.Net - Visual Inheritance


    (Page 3 of 6 )

     

    We now know how to create objects of classes. Just in a similar fashion, we can also inherit from a form.

    Is it possible to inherit the components of the parent form?

    Yes, it is possible. But inheriting the controls does not mean that we are able to view the controls in the child forms because we inherit the controls, and not the properties of those controls, which we had set into the Parent form. Suppose we have placed a Button in the Parent form, and its top position is at 200px. This does not depict that if we inherit the Parent Form for the child class then we will be able to see the same Button at the same position (i.e. Button1.Top = 200).

    So, How does this all happen? How are we able to see the controls of the parent form at the same location in the child form?

    VS.NET does this by repositioning the controls in the child form. You can experience this. Go and change the position in the Parent Form, but don’t build the Parent form. Now open the Child Form and see the difference in the position of the Button, it is at the previous position.

    This mean that the position of the button has not changed even if we have changed it in the parent form. So what VS.NET does is it resets the properties of the Controls in the Child Form, when we compile the Parent Form.

    Now you understand how VS.NET incorporates Visual Inheritance.

    More VB.Net Articles
    More By Saurabh Verma


     

    VB.NET ARTICLES

    - MyClass - Implementing Polymorphism in VB.Net
    - Building a News Ticker Using VB.Net
    - Everything You Wanted to Know About Forms In...
    - Building Assemblies with VB.Net
    - Simple VB.NET Notify Icon with Panel Applica...
    - Regular Expressions in .NET
    - String Encryption With Visual Basic .NET
    - Deploying Applications in VB.NET: Part 1/2
    - Watching Folder Activity in VB.NET
    - Creating A Windows Service in VB.NET
    - Implementing The Google Web Service In VB.NET
    - Migrating to Visual Basic.NET from Visual Ba...






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
    Stay green...Green IT