Friend Keyword


Friend Keyword

Description

The Friend keyword is used to set the access level for various types and type members. By including this keyword, the associated type or member can be accessed by the entire assembly or application but not by other assemblies that may interact with the type or member.

When combined with the Protected keyword, the related element takes on all aspects of both the Protected and Friend keywords.

The Friend keyword can be used with the following statements:

Class Statement
Const Statement (but not for local constants)
Declare Statement
Delegate Statement
Dim Statement (but not for local variables)
Enum Statement
Event Statement
Function Statement
Interface Statement
Module Statement
Property Statement
Structure Statement
Sub Statement

By default, classes, modules, structures, and interfaces have Friend access.

See Also

For the statements listed above, see the related entries elsewhere in this chapter for usage information. For information on using the Friend keyword as a statement, see the entry for the Dim Statement.

Private Keyword, Protected Keyword, Public Keyword




Visual Basic 2005(c) In a Nutshell
Visual Basic 2005 in a Nutshell (In a Nutshell (OReilly))
ISBN: 059610152X
EAN: 2147483647
Year: 2004
Pages: 712

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net