The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.


The Friend keyword confers friend access on one or more declared programming elements. Friend elements are accessible from within the program that contains their declaration and from anywhere else in the same assembly.

The Friend keyword can be used in conjunction with the Protected 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 Friend keyword is used in these contexts:

Class Statement

Const Statement

Declare Statement

Delegate Statement

Dim Statement

Enum Statement

Event Statement

Function Statement

Interface Statement

Module Statement

Property Statement

Structure Statement

Sub Statement

See Also

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

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2015 Microsoft