Share via


Visual Basic Concepts

Working with Projects

As you develop an application, you work with a project to manage all the different files that make up the application. A project consists of:

  • One project file that keeps track of all the components (.vbp).

  • One file for each form (.frm).

  • One binary data file for each form containing data for properties of controls on the form (.frx). These files are not editable and are automatically generated for any .frm file that contains binary properties, such as Picture or Icon.

  • Optionally, one file for each class module (.cls).

  • Optionally, one file for each standard module (.bas).

  • Optionally, one or more files containing ActiveX controls (.ocx).

  • Optionally, a single resource file (.res).

The project file is simply a list of all the files and objects associated with the project, as well as information on the environment options you set. This information is updated every time you save the project. All of the files and objects can be shared by other projects as well.

When you have completed all the files for a project, you can convert the project into an executable file (.exe): From the File menu, choose the Make project.exe command.

Note   With the Professional and Enterprise editions of Visual Basic, you can also create other types of executable files such as .ocx and .dll files. References in this chapter assume a standard .exe project; for additional information related to other project types see the Component Tools Guide.

For More Information   For more details about creating executables, see "Making and Running an Executable File," later in this chapter. For information about binary data files and project files, see "Visual Basic Specifications, Limitations, and File Formats."

The Project Explorer

As you create, add, or remove editable files from a project, Visual Basic reflects your changes in the Project Explorer window, which contains a current list of the files in the project. The Project Explorer window in Figure 4.1 shows some of the types of files you can include in a Visual Basic project.

Figure 4.1   The Project Explorer window

The Project File

Each time you save a project, Visual Basic updates the project file (.vbp). A project file contains the same list of files that appears in the Project Explorer window, as well as references to the ActiveX controls and insertable objects that are used in the project.

You can open an existing project file by double-clicking its icon, by choosing the Open Project command from the File menu, or by dragging the file and dropping it on the Project Explorer window.

For More Information   The specific format of information stored in the .vbp file is described in "Visual Basic Specifications, Limitations, and File Formats."