Showing Help About Selected Menu Commands
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
- Open your form in the Form Designer.
- From the Standard category of the Tool Palette, drop the Vcl.Menus.TMainMenu menu onto the form.
- 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.
- 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).
- 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
- 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.
- Opening the Menu Designer
- Calling HTML Help from Applications
- Help System Interfaces
- Using Help in a VCL Application