Name
Implements Keyword
Syntax
Implementsinterfacename.interfacemember[, ...]
-
interfacename(required; String literal) The name of the interface being implemented by a class
-
interfacemember(required; String literal) The name of the interface property, function, procedure, or event that is being implemented by a class
Description
Indicates that a class member provides the implementation of a member defined in an interface
Rules at a Glance
The
Implementskeyword can only be used in a class module in which theImplementsstatement has been used to define an abstract base class that the class is to implement.The
Implementskeyword follows the property, function, procedure, or event definition, and must be on the same line.The class member implementing the interface member must be of the same type (property, function, procedure, or event) as the interface member, and its argument list and, in the case of functions and properties, return type must also be identical to that of the interface member.
Class members must implement all of the members declared in the interface.
Example
See the example in the Implements Statement entry.
VB.NET/VB 6 Differences
The
Implementskeyword is new to VB.NET. Its addition means that the implementation of a property, function, procedure, or event does not have to use the name defined by the interface. This modifies the VB 6 practice, which requires that class members that implement an interface definition have the forminterfacename_membername.VB 6 does ...