Standard Modules

A standard module is a type declaration. It is introduced with the Module statement, as shown here:

Public Module ModuleTest
   ' ...
End Module

Tip

Don’t confuse the Visual Basic .NET term, standard module, with the .NET term, module. They are unrelated to each other. See Chapter 3 for information about .NET modules.

Standard module definitions are similar to class definitions, with these differences:

  • Standard module members are implicitly shared.

  • Standard modules cannot be inherited.

  • The members in a standard module can be referenced without being qualified with the standard module name.

Standard modules are a good place to put global variables and procedures that aren’t logically associated with any class.

Get Programming Visual Basic .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.