The MyBase Keyword

You can use the MyBase keyword to call methods in base class

When overriding methods in a derived class. 

The following list describes on using MyBase:

  • MyBase refers to the immediate base class and its inherited members.

It cannot be used to access Private memebers in the class. 

  • MyBase is a keyword, not a real object. MyBase cannot  be assigned to a variable ,

Passed to procedures.

  • You cannot use MyBase to call MustOverride base class methods.
  • MyBase  cannot be used to quality itself. Therefore, the following code is not valid:

 

MyBase.MyBase.BtnOk_Click()       

  • MyBase cannot be used in modules.

 

  • MyBase cannot be used to access base class members that are marked as

Friend if the base class is in a different assembly.


Average Rating (0)
by hetal   more  in VB.Net  on 3/24/2015 11:39:23 PM  


Post Your Comment
*