Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Interface Definition

Interface Definition 

Interface definitions are enclosed within the Interface and End Interface statements. Following the Interface statement, you can add an optional Inherits statement that lists one or more inherited interfaces. The Inherits statements must precede all other statements in the declaration except comments. The remaining statements in the interface definition should be Event, Sub, Function, Property, Interface, Class, Structure, and Enum statements. Interfaces cannot contain any implementation code or statements associated with implementation code, such as End Sub or End Property.

In a namespace, interface statements are Friend by default, but they can also be explicitly declared as Public or Friend. Interfaces defined within classes, modules, interfaces, and structures are Public by default, but they can also be explicitly declared as Public, Friend, Protected, or Private.


The Shadows keyword can be applied to all interface members. The Overloads keyword can be applied to Sub, Function, and Property statements declared in an interface definition. In addition, Property statements can have the Default, ReadOnly, or WriteOnly modifiers. None of the other modifiers—Public, Private, Friend, Protected, Shared, Overrides, MustOverride, or Overridable—are allowed. For more information, see Declaration Contexts and Default Access Levels.

See Also

Community Additions

© 2015 Microsoft