

#VISUAL BASIC ICURSOR INTERFACE LIBRARY CODE#
If you are working within the integrated development environment, the Code Editor implements the class members required by TestInterface when you press ENTER, and you can skip the next step.

When listed separately from other items at the top of a class or structure, the Implements statement indicates that the class or structure implements an interface. If you are working within the integrated development environment, the Code Editor supplies a matching End Class statement when you press ENTER.Īdd the following Implements statement to ImplementationClass, which names the interface the class implements: Implements TestInterface To implement the interfaceĪdd a class named ImplementationClass by adding the following statement to Module1, after the End Interface statement but before the End Module statement, and then pressing ENTER: Class ImplementationClass This difference reflects the fact that interfaces cannot contain implementation code. You may notice that the syntax used to declare interface members is different from the syntax used to declare class members. The Code Editor indents the Interface keyword and adds an End Interface statement to form a code block.ĭefine a property, method, and event for the interface by placing the following code between the Interface and End Interface statements: Property Prop1() As Integer The code for the new module is displayed.ĭefine an interface named TestInterface within Module1 by typing Interface TestInterface between the Module and End Module statements, and then pressing ENTER. Name the new module Module1.vb and click Add.

#VISUAL BASIC ICURSOR INTERFACE LIBRARY WINDOWS#
Open a new Visual Basic Windows Application project.Īdd a new module to the project by clicking Add Module on the Project menu. For more information, see Personalizing the IDE. The Visual Studio edition that you have and the settings that you use determine these elements. Your computer might show different names or locations for some of the Visual Studio user interface elements in the following instructions.
