Visual Basic Concepts

Providing Help and Browser Strings for Objects

Objects are created from classes. The Object Browser displays information about the classes from which objects are created.

The following procedure can be used to link Help topics and provide browser strings for classes, and for their properties, methods, and events. When Visual Basic creates the type library for your component, it includes this information. Users of your component can view the description strings using the Object Browsers in their programming tools, and jump to your Help topics.

For an alternate method of supplying Help and browser strings for properties, methods, and events, see "Providing Help and Browser Strings for Properties, Methods, and Events."

To enter description strings and link your classes and their members to Help topics

  1. Press F2 to open the Object Browser. In the Project/Library box, select your project.

    If you’re not sure which is the Project/Library box, hover the mouse pointer over the boxes until you see the tool tip.

  2. In the Classes list, right click the name of a class to bring up the context menu, and click Properties to open the Member Options dialog box.

    Alternatively, in the Members list, right click the name of a property, method, or event to bring up the context menu, and click Properties to open the Member Options dialog box.

  3. In the Help Context ID box, type the context ID of the Help topic to be shown if the user clicks the "?" button when this class or member is selected in the Object Browser.

    The path and name of the Help file for the project should appear in the Help File box. If it does not, see "How to Specify a Help File for Your Component" for instructions on setting it.

  4. In the Description box, type a brief description of the class or member.

  5. Click OK to return to the Object Browser. The description string you entered should appear on the panel at the bottom of the browser.

  6. Repeat steps 2 through 5 for each class and for each member of each class.

Figure 7.2 shows the Object Browser and Member Options dialog box as they would appear when setting the description and Help context ID for a class in a hypothetical test application.

Figure 7.2   Setting the description and Help context ID

Note   You can enter Help context IDs and descriptions for private classes in your component, but this information will only be available to you when you’re actually working on your component project. It will not appear in the type library for your component.

You cannot supply browser strings or Help topics for enumerations.

For More Information   Creating Help files is discussed in the Microsoft Windows Help Authoring Kit, available from Microsoft Press. User assistance features available for components are listed in "Providing User Assistance for ActiveX Components."