Showing Help About Selected Menu Commands

From RAD Studio
Jump to: navigation, search

Go Up to Calling HTML Help from Applications

RAD Studio provides the possibility to show help topics describing particular menu items. When you highlight a menu item, you can press F1 to show an associated help topic.

To assign a help topic to your menu item

  1. Open your form in the Form Designer.
  2. From the Standard category of the Tool Palette, drop the Vcl.Menus.TMainMenu menu onto the form.
  3. Double-click the menu to open the Menu Designer. Create or select the menu item to which you want to assign a help topic; the Object Inspector shows its properties. Find the HelpContext property and, in the right cell, type the context ID of the topic to associate with this menu item.
  4. To define the help file, set the HelpFile property of the global Application object (TApplication.HelpFile property) or of a particular form (TForm.HelpFile property).
  5. To specify that your application uses the API of the HTMLHelp function that shows CHM help files, do either of the following:
    • In a Delphi application, add the Vcl.HtmlHelpViewer unit to the uses clause of the main module of your application.
    • In a C++ application, add the #include Vcl.HtmlHelpViewer.hpp directive.
  6. Select the Run > Run command. Your application opens. Using the mouse, highlight one of the menu items to which you have assigned the HelpContext property. Press F1; the application shows the help topic having the assigned HelpContext identifier from the help file specified by the HelpFile property.

See Also