Implementing and Accessing Interfaces

Implementing interfaces means telling a class that it needs to expose all members defined within the interface. This task is accomplished by using the Implements keyword followed by the name of the interface. The following code snippet shows how to implement the IDocument interface within a Document class:


You immediately notice that, when pressing Enter, the Visual Studio IDE automatically generate members’ templates for you. This is useful: You do not need to waste your time in writing members’ signatures. You also notice that when a member is defined within a class because of the interface implementation, ...

Get Visual Basic 2010 Unleashed now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.