Form module: – A form module are the foundation of most visual basic application. As we work on a project, it forms are stored in files, one form to a file. The control that reside on the form are also saved in the forms file. A form file have the file extension .frm. The form file that make up project are listed in project explorer window. Form modules provide the user interface to an application. They contain procedure that handle event, general procedure and form level declaration of variables, constant, types and external procedure. The declaration in the form module are private by default. The constant variable and procedure of a form are not available to the code outside the form, unless the declaration are public. The code that we write in a form module is specific to the particular application to which the form belongs. It might also reference other forms or object with in the application.

Each form module contains event procedure that section of code where we place the instruction that will execute in response to specific event. Forms can contain control. For each control on a form, there is a corresponding set of event procedure in the form module. In addition to procedure, form module can contain general procedure that are executed in response to a call from any event procedure. When we want to work with a form, select it in the project explorer window and choose either view code or view form button, depending on whether we want to view the form’s code or the form itself.

Class module: – Class module are the foundation of object oriented programming in visual basic programming they have file name with .cls extension. We can write code in class module to create new object. These new object can include our own customize properties and modules. Actually, form are just class module that have control placed on form and can we display form windows. Class modules do not have visual component as compare to form module.

Standard module: – Standard module are container for procedure and declaration, commonly accessed by other module with in the application. Standard module have the file name with extension .bas. They can contain global or module label declaration of variable, constant, types, external procedure and global procedure. The code that we write in a standard module is not necessarily tide to particular application.

Advertisements