Языки

PHP
Функции  Добавить  Пользователи  Регистрация  Вход   Ресурс  Таблица ASCII  Помощь

VB.Net


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

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.


1 2 3 4 5 6
NSF, NBC News and the NFL Kick Off "Science of NFL Football"

NFL athletes explore "Projectile Motion & Parabolas" in one of 10 new videos.

In America, the autumn season means two things -- back to school and back to football. To celebrate both events, NBC News' educational arm, NBC Learn, is teaming up with the National Science Foundation (NSF) and the National Football League (NFL) to release the "Science of NFL Football"- an informative 10-part video series that explores the science behind America's most beloved sport. Narrated by NBC News' Lester Holt and made especially for students and teachers as they ...

More at http://www.nsf.gov/news/news_summ.jsp?cntn_id=117654&WT.mc_id=USNSF_51&WT.mc_ev=click


This is an NSF News item.

English
version


Статьи
Articles


Книги
Library


Скачать
Downloads

 © Internet, books, teachers and Rudevich Alexander brains.