Visual Basic Concepts

Creating, Opening, and Saving Projects

Four commands on the File menu allow you to create, open, and save projects.

Menu command Description
New Project Closes the current project, prompting you to save any files that have changed. You can select a type of project from the New Project dialog. Visual Basic then creates a new project with a single new file.
Open Project Closes the current project, prompting you to save any changes. Visual Basic then opens an existing project, including the forms, modules, and ActiveX controls listed in its project (.vbp) file.
Save Project Updates the project file of the current project and all of its form, standard, and class modules.
Save Project As Updates the project file of the current project, saving the project file under a file name that you specify. Visual Basic also prompts you to save any forms or modules that have changed.

It is also possible to share files between projects. A single file, such as a form, can be part of more than one project. Note that changes made to a form or module in one project will be propagated amongst all projects that share that module.

For More Information   For more information about sharing files, see "Adding, Removing, and Saving Files" later in this chapter.

Working with Multiple Projects

In the Professional and Enterprise editions of Visual Basic, it is possible to have more than one project open at a time. This is useful for building and testing solutions involving user-created controls or other components. When more than one project is loaded, the caption of the Project Explorer window will change to Project Group and the components of all open projects will be displayed.

To add an additional project to the current project group

  1. From the File menu, choose Add Project.

    The Add Project dialog box is displayed.

  2. Select an existing project or a new project type, and choose Open.

To remove a project from the current project group

  1. Select a project or a component of a project in the Project Explorer.

  2. From the File menu, choose Remove Project.

For More Information   To learn more about working with multiple projects, see "Creating ActiveX Components" in the Component Tools Guide.