The set of controls available in the toolbox can be customized for each project. Any given control must be in the toolbox before you can add it to a form in the project. The basic set of standard controls that always appear in the toolbox is described in "Forms, Controls, and Menus."
You can add ActiveX controls and insertable objects to your project by adding them to the toolbox.
To add a control to a project's toolbox
The Components dialog box is displayed, as shown in Figure 4.3. The items listed in this dialog box include all registered ActiveX controls, insertable objects, and ActiveX designers.
To view controls with .ocx file name extensions, select the Controls tab. To view insertable objects, such as a Microsoft Excel Chart, select the Insertable Objects tab.
Figure 4.3 The Components dialog box
To add ActiveX controls to the Components dialog box, choose the Browse button, and search other directories for files with a .ocx file name extension. When you add an ActiveX control to the list of available controls, Visual Basic automatically selects the check box.
Note Each ActiveX control is accompanied by a file with an .oca extension. This file stores cached type library information and other data specific to the control. The .oca files are typically stored in the same directory as the ActiveX controls and are recreated as needed (file sizes and dates may change).
To remove a control from a project
The Components dialog box is displayed.
The control icons will be removed from the toolbox.
Note You cannot remove any control from the toolbox if an instance of that control is used on any form in the project.
You can also use objects from other applications, such as those included in the Microsoft Excel object library, either as controls in the toolbox or as programmable objects in your code. To add objects to the toolbox, see "Adding Controls to a Project" earlier in this chapter.
To make another application's objects available in your code, but not as controls, set a reference to that application's object library.
To add a reference to another application's object library
The References dialog box is displayed, as shown in Figure 4.4.
To add references to applications not listed in the References dialog box, choose the Browse button, and then select the application.
Figure 4.4 The References dialog box
If you are not using any objects in a referenced library, you should clear the check box for that reference to minimize the number of object references Visual Basic must resolve, thus reducing the time it takes your project to compile.
Once you have set references to the object libraries you want, you can find a specific object and its methods and properties in the Object Browser by choosing Object Browser from the View menu. You can use any object listed in the Object Browser in your code.
For More Information " For information on the Object Browser, see "Finding Out About Objects" in "Programming with Objects."
A resource file allows you to collect all of the version-specific text and bitmaps for an application in one place. This can include constant declarations, icons, screen text, and other material that may change between localized versions or between revisions or specific configurations.
To add a file to a project
The Add File dialog box is displayed.
A single project can have only one resource file; if you add a second file with a .res extension, an error occurs.
For More Information For more information on the contents of a resource file, see "International Issues."