Adding Context Sensitivity to WinHelp
Context-sensitive Help allows users to easily access Help topics relating to what they are doing or seeing in your application at any given time. For example, if a user is viewing a data entry form, context-sensitive Help could provide a topic relating specifically to that data entry form.
You decide the level of detail at which context-sensitive Help is implemented in you application. For example, you can associate a context-sensitive Help topic with a form, or you can associate more detailed Help topics with each control and field on your form.
Context-sensitive Help is typically accessed by pressing F1, but you can specify any key to activate context-sensitive Help with ON KEY LABEL.
Using Context-Sensitive WinHelp on a Form
To implement context-sensitive Help, you must specify a Help file for your application, and then associate specific Help topics with different objects in your application.
To add context-sensitive Help
- Specify a Help file for your application.
- Assign a Help topic to each object for which you plan to provide context-sensitive Help.
Specifying a Help File
You determine the Help file that can be accessed in your application by including the command SET HELP TO file in your code, where file is the name of your Help file. For example, if your Help file is called Myhelp.hlp, you can use the following command:
SET HELP TO MYHELP.HLP
This command is typically included in the setup code for the main program of your application.
Assigning Help Topics
You can assign a Help topic to specific objects in your Visual FoxPro application.
To assign a Help topic to an object
- In Design mode, open the object — a form, control, or toolbar, for example — that you want to assign context-sensitive Help to.
- View the object's properties.
- Set the HelpContextID property to the number representing a specific topic in your Help file.
For more information about mapping Help topics to context ID numbers, see the Help Authoring Guide.
Note To assign Help topics to menu titles or menu commands, you must include the SET TOPIC TO command in the procedure associated with the menu title or menu command.
See Also
WinHelp 4.0 | Implementing "What's This?" WinHelp | Programming WinHelp Features | ON KEY LABEL | Creating Help