Mybase means always look in the base class for the property, not the property held in derived class.
An example of this would be an overridded Age property that looked at the today's year minus date of birth year. This is fine for most employers apps but terrible if you're looking for whether they can vote of not. Hence you would refer to Mybase.DOB, not Me.DOB
When your class inherits from another class (and in .NET they *all* inherit from System.Object), you use the MyBase keyword to refer to the class you're inheriting from (the parent).
Typically it's used when you're overriding a method originally provided by the parent class, and you need to call the parent before doing some work yourself. Happens all the time when you write a custom control.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.