Home arrow VB.Net arrow Page 3 - Everything You Wanted to Know About Forms Inheritance in VB.Net
VB.NET

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


Learn how to take advantage of Forms Inheritance, while being introduced to certain Object Oriented approaches, in Saurabh's latest article.

Author Info:
By: Saurabh Verma
Rating: 4 stars4 stars4 stars4 stars4 stars / 215
October 29, 2003
TABLE OF CONTENTS:
  1. · Everything You Wanted to Know About Forms Inheritance in VB.Net
  2. · Concept of Inheritance
  3. · Visual Inheritance
  4. · Whatís New in This Article
  5. · What's New in This Article, Cont'd
  6. · Conclusion

print this article
SEARCH DEVARTICLES

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.


blog comments powered by Disqus
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...

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials