Review and Preview
In Class 1, we learned the important parts of a Visual Basic project. We saw that a project is built on a form using controls. By interacting with the controls using events, we get the computer to do assigned tasks via instructions we provide.
In this second class, we will learn the beginning steps of building our own Visual Basic projects by looking at the different parts of the project and where they fit in the Visual Basic environment. Like Class 1, there are also a lot of new terms and skills to learn.
Parts of a Visual Basic Project
In Class 1, we saw that there are three major components in a Visual Basic project: the project itself, the form, and the controls. Project is the word used to encompass everything in a Visual Basic project. Other words used to describe a project are application or program. The Form is the window where you create the interface between the user and the computer. Controls are graphical features or tools that are placed on forms to allow user interaction (text boxes, labels, scroll bars, command buttons). Recall the form itself is a control. Controls are also referred to as objects. Pictorially, a project is:
So, a project consists of a form containing several controls. In looking around your computer's file directory, you may find some files associated with a Visual Basic project. Two primary files are used to save a Visual Basic project. The project file will have an extension of vbp (in addition, there is sometimes a file with a vbw extension).
The form file has an extension of frm (in addition, there is sometimes a form file with a frx extension). Look in your project folder (VB4Projects, VB5Projects, or VB6Projects) and see if you can find Sample.vbp and Sample.frm - those are the files for the project you opened in Class 1. You need to know these extensions for proper opening and saving of your projects.