Developer

Working with project groups in VB6

There may be times when you need to work on more than one project at the same time because the projects are dependent on each other in some way. Learn the ins and outs of working with project groups in VB6.

There are many VB6 development tasks that you can accomplish within a single project. However, you may need to work on more than one project at the same time because the projects are dependent on each other in some way.

For example, say you're working on an ActiveX control project at the same time that you're working on a Standard EXE project that uses the ActiveX control. In situations such as this, you can have two or more projects open at the same time in a group. When you save the group, you save information about all the contained projects. Later, you can open the group, and all the contained projects will open at the same time. You can also open each project independently, regardless of whether it's part of a group.

How to create a group

First, open or create the first project in the group. Then, you can add an existing or new project to the group by selecting Add Project from the File menu. VB will display the Add Project dialog box. Use the New tab to add a new project or use the Existing tab to add an existing project.

When you have two or more projects open, the Project window lists each one, arranging forms and other project components hierarchically under the project name. You can remove a project from the group by right-clicking it in the Project window and selecting Remove Project from the pop-up menu. Removing a project from a group doesn't affect the project files on the disk.

VB groups save as VBG files. To save a group, select Save Project Group from the File menu. (Saving the group also saves the individual projects.)

When you're working with a group, VB needs to know which project is the startup project. To set this, right-click a project name in the Project window and select Set as Startup from the pop-up menu. By default, the first .EXE project that you add to a group is the startup project. Of course, any group can have only one startup project.

Advance your scripting skills to the next level with TechRepublic's free Visual Basic newsletter, delivered each Friday. Automatically sign up today!

Editor's Picks