Shadows - Visual Basic (original) (raw)

Specifies that a declared programming element redeclares and hides an identically named element, or set of overloaded elements, in a base class.

Remarks

The main purpose of shadowing (which is also known as hiding by name) is to preserve the definition of your class members. The base class might undergo a change that creates an element with the same name as one you have already defined. If this happens, the Shadows modifier forces references through your class to be resolved to the member you defined, instead of to the new base class element.

Both shadowing and overriding redefine an inherited element, but there are significant differences between the two approaches. For more information, see Shadowing in Visual Basic.

Rules

The Shadows modifier can be used in these contexts:

See also