Visual Basic Language Reference  

Protected

The Protected keyword confers protected access on one or more declared programming elements. Protected elements are accessible only from within their own class or from a derived class. Protected access is not a superset of friend access.

The Protected keyword can be used in conjunction with the Friend keyword in the same declaration. This combination confers both friend and protected access on the declared elements, so they are accessible from the same assembly, from their own class, and from any derived classes.

The Protected keyword is used in these contexts:

Class Statement

Const Statement

Declare Statement

Delegate Statement

Dim Statement

Enum Statement

Event Statement

Function Statement

Interface Statement

Property Statement

Structure Statement

Sub Statement

See Also

Friend | Accessibility | Procedures | Structures: Your Own Data Types | Understanding Classes