Share via


Visual Basic Concepts

Providing Help and Browser Strings for Properties, Methods, and Events

You can use the Procedure Attributes dialog box to enter description strings for your properties, methods, and events, and to provide links to topics in your Help file. 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 the Help topics.

You can use the Visual Basic Object Browser to enter description strings for your classes, as described in "Providing Help and Browser Strings for Objects." The Object Browser can also be used to enter this information for properties, methods, and events.

To enter description strings and link Help topics to your properties, methods, and events

  1. In the Project window, select a module and press F7 (or click View Code on the Project window toolbar) to open its code window.

  2. On the Tools menu, click Procedure Attributes to open the Procedure Attributes dialog box.

  3. Select a property, method, or event in the Name box.

  4. 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 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.

  5. In the Description box, type a brief description of the member.

  6. Click the Apply button to save the information.

  7. Repeat steps 3 through 6 for each property and method in the module.

Figure 7.3 shows the Procedure Attributes dialog box as it would appear when setting the description and Help context ID for a member of a class in a hypothetical test application.

Figure 7.3   Setting the description and Help context ID

Note   You can enter Help context IDs and descriptions for members of 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."