Mapping Visual Basic 4.0: The VBIDE Object


Ken Lassesen
Microsoft Developer Network Technology Group

July 24, 1995

 

Download Now Sample Files Package:MAP2240B.ZIP

Abstract

This article consists primarily of a graphic map of the Visual Basic® [Integrated] Development Environment (VBIDE) object, which shows its properties, methods, and child objects. This map provides a quick reference to the VBIDE object in Visual Basic version 4.0.

The VBIDE Object

The Visual Basic® [Integrated] Development Environment object (VBIDE) is available only in Visual Basic version 4.0. Using the VBIDE, developers may create add-ins for the development environment. For information on creating add-ins, see my article titled "Building Add-Ins for Visual Basic 4.0."

The VBIDE object diagram shows the relationship between objects as described by the Object Viewer. The Parent and Application properties exist for all objects, so the diagram omits them.

A map is a good learning aid and a quick reference when developing an application. I started producing maps after a week of leaving dents in walls trying to work with some unfamiliar objects. After producing a map, I found that it was easy to work with the object: I just post the appropriate map on my wall for quick reference, which is a lot faster than clicking objects in a Help file one by one to discover their properties and methods.

Because Figure 1 is unreadable online, I have included the two most common graphics formats--encapsulated PostScript™ (.EPS) and Windows® metafile (.WMF)--as well as a copy of my original Shapeware® Visio™ version 3.0 file (.VSD). The first two formats can be printed across multiple pages using any of the commercial graphics applications--such as Adobe™ PageMaker™, Corel® Draw, or Microsoft® Publisher--or using Microsoft Excel. The original Visio file is included for those who have a copy of Visio and wish to modify the diagram easily.

[MAP2240B  10380 bytes ]

Figure 1. The Visual Basic Development Environment

Object Definitions

The objects and collections in Figure 1 are defined in Table 1.

Table 1. Object and Collection Definitions

Object or Collection Definition
Application Object This object represents the application connected to the add-in. This object exposes certain properties of the current instance of Visual Basic itself. Using the properties of this object, an add-in can access all the objects supported by Visual Basic. The ConnectAddIn event of an add-in class module instance receives the Application object when an add-in is installed in an instance of Visual Basic.
SubMenu Object This object represents a menu item that may have child MenuItem objects on the Visual Basic menu bar under Add-Ins.
MenuItem Object This object represents a menu item that will send Click events to a class module connected to the VBIDE with the MenuLine.ConnectEvents method.
FileControl Object This object is supplied by Visual Basic to support file-control events in add-ins. The FileControl object monitors all notifications of file changes in Visual Basic. The add-in specifies which class-module instance within the add-in will receive file-control events using the FileControl.ConnectEvents and FileControl.DisconnectEvents methods. File-control events invoke class-module methods.
ProjectTemplate Object This object represents the project loaded in the referenced VBIDE instance. The ProjectTemplate object allows access to forms, modules, class modules, controls, and references in the project.
FormTemplate Object This object represents a form in a Visual Basic project. The properties, controls, and currently selected controls of a form are available through this object. The add-in can add controls, code, and menu lines to the form using this object.
SelectedControlTemplate Collection This collection contains all the selected ControlTemplate objects on the active FormTemplate object.
Properties Collection This collection contains all the Property objects for a specific instance of a FormTemplate object or a ControlTemplate object.
Property Object This object represents a built-in characteristic or a user-defined characteristic of a FormTemplate object or a ControlTemplate object. These are the same design-time characteristics that appear when the developer presses F4.
Components Collection This collection contains all the Component objects for the project.
Component Object This object represents a resource file, a form, a module, or a class module.
SelectedComponents Collection This collection represents the currently selected Component objects in the project. Only one item is in the SelectedComponents collection. (This may change in future versions.)

 

El original lo puedes encontrar en: Microsoft MSDN