Partager via


Programming HTML Help Features

You can program your application so that users can access your HTML Help system. Although an HTML Help system can consist of one or more separate files, Help appears to users as part of your application.

You can program your Visual FoxPro application to use graphical and .dbf-style Help with the SET HELP TO and SET TOPIC TO commands. SET HELP TO specifies the name of a custom Help file for your application. SET TOPIC TO sets the identifying keyword for a topic in the custom Help file.

Reserving F1

When a user presses F1 in your application, Visual FoxPro can display a context-sensitive Help topic. To do this, assign a Help context ID to a topic in your Help table and assign the same value to the HelpContextID property of your form or control. When the form or control has the focus and the user presses F1, Visual FoxPro displays the matching topic.

Note   F1 is enabled for context-sensitive Help by default. Because this is a recognized standard for Help, redefining this key is not recommended.

Including Help Buttons on Forms

If you add Help buttons to your forms, users can access Help more easily. You should especially consider adding a Help button if your user is a novice.

To set context sensitivity and add a Help button

  1. In the Init event for your form, set the HelpContextID property for all the form's objects to the same value you assigned to the Help topic. For example, if the value is 7, you can use the following command:

    THIS.SetAll("HelpContextID", 7)
    
  2. Add a command button to your form.

  3. Set the Caption property of the command button to Help.

  4. In the Click event of the command button, add the following command:

    HELP ID THIS.HelpContextID
    

    Tip   Save the Help button as a class so that you can easily add it to any form. For more information about saving objects as classes, see Creating Forms.

Distributing a Compiled HTML System.

In addition to the .chm file you create for your HTML Help system, you can use a free-distributable setup program, Hhupd.exe, which will install and register the HTML Help runtime components listed below. Internet Explorer or the Internet Explorer runtime engine must be installed on your users' machines.

Component Name Description
Hhctrl.ocx HTML Help ActiveX control
Itss.dll Dynamic link library that handles compiled HTML
Itircl.dll Full-text search Dynamic link library
Hh.exe HTML Help viewer

You will find this setup program in the Redist folder in the folder where HTML Help Workshop has been installed. This setup program can be called from other setup programs, and can be made to run in 'quiet' mode so that it does not interfere with the setup program you may have already created. For a complete list of command line options, run Hhupd.exe/?.

See Also

Implementing "What's This?" HTML Help | WinHelp 4.0 | Creating Graphical Help | HTML Help | Creating .DBF-Style Help | SET HELP TO