Creating Classes and Objects
The first step in utilizing classes and objects is to define the required classes. Each class is defined in a unique class file (with a .cls extension) that is added to the project.
These notes assume that you have already created a project and are ready to add a class to it.
To add a class to a project, select Add Class Module from the Project menu.

The Add Class Module dialog box appears, as shown below. From this screen you can add a new class or an existing class to the project. In this example the Class Module icon will be selected and double clicked.

Visual Basic adds a class module to the project with the default name Class1, and also opens the code window for the new class so that it can be edited.
The next step is to change the Name property of the class so that it reflects the class name that describes the class. The Properties window is used to set the new class's Name property, in this case to clsEmployee. Class names are generally prefixed with "cls" in Visual Basic programs.

Be sure to select clsEmployee in the Project window and choose Save from the File menu. Visual Basic will prompt for the class name and the correct folder. Be sure that it saves the class in the same folder as your project and form. Note that Visual Basic appends a .cls extension to class files.

As discussed previously, classes serve as templates for objects, and as such encapsulate both attributes and methods. In Visual Basic those methods can be functions or subs.
Please Report Errors in Notes Here