Changes

Jump to: navigation, search

Visual Basic Modules and Procedures

1 byte removed, 16:16, 30 July 2007
no edit summary
Visual Basic application source code is structured into ''module'' files with ''.vb'' suffix. By default, Visual Studio creates a separate module file for each form in an application containing the code to construct the form and any code that has been defined by the developer in the event procedures.
When writing additional Visual Basic for an application the code should ideally be logically grouped to together with other source code in a module file. When we say ''logically grouped'' we mean that the code shopuld be grouped with other code of a similar nature. For example, code to work with files might be placed in a module called FileIO.vb, while mathematical procedures might all reside in a file name Math.vb. The idea is to ensure Visual Basic code is place d placed in a file where it make sense for it to be located. This will differ between applications, but it is worth investing the time to ensure code is well structured as doing so makes subsequent maintenance of the code by you or other developers much easier.
We mentioned previously that Visual Studio places the code to construct each form in a separate module file. We now need to learn how to create a new module in a project to ocntian our own Visual Basic code.

Navigation menu