The Object Browser contains much of the same information as the online help system. The Object Browser, however, specifically targets the VB programmer and offers succinct information that's needed often. For example, the <globals> entry in the Classes list describes all of VB's built-in functions. Scroll down to the Left entry to learn about the Left() function.
As you learned in Hour 14, "Using the Supplied Functions," the Left() function returns the left part of a string.![]()
When you highlight the Left entry, VB describes the function at the bottom of the Object Browser window. The text not only describes the function's purpose but also shows the function's syntax. You can tell the nature of each object listed in the Members drop-down list by its icon. The small green icon indicates that the member is a function. You can spot collections (look at the Forms entry) and named literals by their respective icons. Scroll down to see the entire list of named literals that appears below the functions and collections in the Members scrolling list.
If you right-click either list and select Group Members
from the pop-up menu, Visual Basic groups all members and classes
by their purpose. Therefore, rather than have the literals appear
in alphabetical order, the Object Browser displays all the named
literals together, all the events together, and so on.
After you highlight any entry in an Object Browser window, click the toolbar's Help button (the icon is a question mark) to get online help on that object.![]()
You can get even more specific with the Object Browser. For example, the Classes list contains several entries that reference constants (another term for literals). When you click the ColorConstants entry, for example, only VB's color constants appear in the Members list (see Figure 20.3).
The object search has been narrowed to particular constants.
You may use these named literals anywhere in code that you need a color. For example, you can set a form's background color this way:
Notice that all the controls available in the Toolbox also appear in the Classes list. If you click on ComboBox, for example, the Object Browser displays all pertinent information for combo boxes, including properties, events, and methods. If you click one of the combo box entries in the Members list, you get a description of that method, event, or property.